随笔分类 -  Thread

摘要:BlockingQueue 它实现了Queue接口。它是A BlockingQueue with one thread putting into it, and another thread taking from it. 一端生产一端消费。 其中的一个线程将不断的将任务放入BlockingQueu 阅读全文
posted @ 2016-05-01 23:06 平林新袖 阅读(879) 评论(0) 推荐(0)
摘要:Executor框架是指java5中引入的一系列并发库中与executor相关的功能类,包括Executor、Executors、ExecutorService、CompletionService、Future、Callable等。(图片引用自http://www.javaclubcn.com/a/ 阅读全文
posted @ 2016-03-25 22:22 平林新袖 阅读(351) 评论(0) 推荐(0)
摘要:一、简介 ThreadLocal的引入,在多线程情况下,实现线程变量的共享,但是又不相互影响,也就是所说的线程隔离。 下面是非线程安全的方法实现 1 package com.volshell.threads; 2 3 import java.util.Date; 4 import java.u... 阅读全文
posted @ 2015-09-16 13:21 平林新袖 阅读(216) 评论(0) 推荐(0)