Concurrency & Thread Pool

2019-04-07  本文已影响0人  michael_0x

No Thread Pool, high cost to create new threads

image.png

Thread Pool to reuse threads already created

image.png

Consideration:

image.png

Thread Pools Java offered:

image.png

CachedThreadPool:

image.png

ScheduledThreadPool

image.png

constructor

image.png image.png image.png

remark: 0 seconds means not applicable

Queue types for different pools

image.png

task reject policy

image.png image.png image.png

Life Cycle

image.png

Callable & Future

image.png image.png image.png
上一篇 下一篇

猜你喜欢

热点阅读