Ashley
Ashley

Reputation: 659

ForkjoinPool doesnt have a BlockingQueue

Why does ForkJoinPool not have a BlockingQueue like ThreadPoolExecutor? It also doesn't seem to have a rejection queue.

I have been using ThreadPoolExecutor and blocking queues for both the above purposes are able to help asynchronous operations, which seems harder with ForkJoinPool. Any suggestions or comments will help.

Upvotes: 0

Views: 525

Answers (1)

John Vint
John Vint

Reputation: 40256

ForkJoinPool is special in which it doesnt have just one Queue. It actually has as many queues as there are threads and the threads will execute off it's queue and when empty steal work from another thread's queue.

That being said, you shouldn't be given the option to override the queue considering its complexity.

Upvotes: 1

Related Questions