摘要:
1.线程池的状态常量,这里只详细分析其中一个,其他类同,这里看RUNNING状态: // -1的补码为:111-11111111111111111111111111111 // 左移29位后:111-00000000000000000000000000000 // 10进制值为:-536870912 阅读全文
posted @ 2020-09-02 15:55
小窝蜗
阅读(304)
评论(0)
推荐(0)
摘要:
byte: byte数据类型是8位、有符号的,以二进制补码表示的整数;(256个数字),占1字节 最小值是-128(-2^7); 最大值是127(2^7-1); 默认值是0; byte类型用在大型数组中节约空间,主要代替整数,因为byte变量占用的空间只有int类型的四分之一; 例子:byte a 阅读全文
posted @ 2020-09-02 11:25
小窝蜗
阅读(209)
评论(0)
推荐(0)
摘要:
1.状态控制 状态控制主要围绕原子整型成员变量ctl: private final AtomicInteger ctl = new AtomicInteger(ctlOf(RUNNING, 0)); private static final int COUNT_BITS = Integer.SIZE 阅读全文
posted @ 2020-09-02 11:08
小窝蜗
阅读(261)
评论(0)
推荐(0)
摘要:
1.设计者(Doug Lea) 2.ThreadPoolExecutor实现的最顶层接口 public interface Executor { void execute(Runnable command); } 说明:ExecutorService提供了很多扩展方法底层基本上是基于Executor 阅读全文
posted @ 2020-09-02 10:22
小窝蜗
阅读(200)
评论(0)
推荐(0)

浙公网安备 33010602011771号