摘要: 一、Executor执行器 1.Executor接口,java线程池框架中的顶层接口,提供一个execute方法来执行任务 import java.util.concurrent.Executor; public class T01_MyExecutor implements Executor { 阅读全文
posted @ 2017-09-06 18:39 Ghostor 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 目录: 1.线程安全单例模式的几种实现方式 2.同步容器 3.并发容器 一、线程安全单例模式的几种实现方式 1.饿汉式(不使用同步锁,典型的用空间换时间) public class Singleton1 { private static Singleton1 mySingleton = new Si 阅读全文
posted @ 2017-09-06 15:00 Ghostor 阅读(413) 评论(0) 推荐(0) 编辑