에 대한 우선권을 얻기 전에 얼마나 많은 스레드가 시작될 것인지로 결정된다. 핵심 풀 크기에 도
달되자마자 태스크는 새롭게 생성된 스레드에서 실행되는 대신 큐에 들어간다.
int N
=
Runtime
.
getRuntime
().
availableProcessors
();
ThreadPoolExecutor executor
=
new ThreadPoolExecutor
(
0
,
N
*
2
,
60L
,
TimeUnit
.
SECONDS
,
new ArrayBlockingQueue
<
Runnable
>(
10
));
0
개의 핵심 스레드와
10
개 태스크를 보유할 수 있는 제한된 큐에서는, 스레드 생성을 시작하는
11
번째 태스크가 삽입될 때까지 실제로 어떤 태스크도 실행되지 않는다.
9.3
태 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.