
并发
zy1104560031
这个作者很懒,什么都没留下…
展开
-
并发2018-11-27
volatile关键字,使一个变量在多个线程间可见。 使用volatile,将会强制所有线程都去堆内存读running的值。 synchronized:既有可见性又有原子性。volatile只是保障了可见性(效率高)。 synchronized和volatile的区别? wait和notify:wait()释放锁 count.incrementAndGet();//代替cou...原创 2018-11-27 17:31:43 · 116 阅读 · 0 评论 -
并发2018-11-18
六种线程池: FixedThreadPool CacheThreadPool SingleThreadExecutor ScheduledThreadPool ForjJoinPool WorkStealingPool package Thread26; import java.util.concurrent.ExecutorService; import java.util.c...原创 2018-11-28 11:43:01 · 145 阅读 · 0 评论 -
Thread.join源码解析
/* * * Waits for this thread to die. *等待该线程终止的时间最长为 millis 毫秒。超时为 0 意味着要一直等下去。 * <p> An invocation of this method behaves in exactly the same * way as the invocation * * <blockquote&g...原创 2019-07-17 15:33:28 · 157 阅读 · 0 评论