0

I understand that in Work Stealing Pool each thread has its own queue where as Fixed Thread Pool has a single shared unbounded queue.

But I'm still not clear in deciding which one is better among them in terms of performance. I see that work stealing pool has an advantage because it steals the work from other thread's queue when it is done processing all of its tasks and both of them use a fixed number of threads.

So is work stealing pool always a better choice ?

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Apr 18, 2022 at 13:12

1 Answer 1

0

The work-stealing thread pool does not support Future.cancel(true). If you need to interrupt the thread (e.g. using Thread.sleep), you need to use the fixed thread pool. If not, it would be better to use the work-stealing thread pool.

Please see also here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.