
多线程
黄都伟
这个作者很懒,什么都没留下…
展开
-
多线程为什么调用start而不是调用run方法
run方法只是其中一个方法, public void run() { if (target != null) { target.run(); } }而start方法为线程安全,且采用JVI技术实现了多线程 public synchronized void start() { /**原创 2017-02-26 11:50:50 · 944 阅读 · 0 评论 -
多线程死锁
package com.cxstock.action;public class test { public static void main(String[] args) { TestDeadLock td1 = new TestDeadLock(); TestDeadLock td2 = new TestDeadLock(); td1.flag = 1; td2.flag转载 2017-02-27 14:02:27 · 338 阅读 · 0 评论