-
Notifications
You must be signed in to change notification settings - Fork 46k
Closed
Description
线程池常用的阻塞队列有哪些?
这里提到的 DelayedWorkQueue 添加元素满了之后会自动扩容,增加原来容量的 50%,即永远不会阻塞,最大扩容可达 Integer.MAX_VALUE,所以最多只能创建核心线程数的线程。
有点问题,PriorityQueue.grow()
应该是小数组(<64)变成oldCapacity + max(minGrowth, oldCapacity+2),大数组(≥64)oldCapacity + max(minGrowth, oldCapacity/2) 才是增加原来容量的 50%
Metadata
Metadata
Assignees
Labels
No labels