From the course: Java EE: Concurrency and Multithreading

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Different thread pools

Different thread pools

From the course: Java EE: Concurrency and Multithreading

Start my 1-month free trial

Different thread pools

- [Instructor] In the previous demo we tried to use the FixedThreadPool on the executor's utility clause. However, the executor framework allows you to create different kinds of pools. Let's take a very quick look at that. So instead of the newFixedThreadPool, you can also say newCashedThreadPool. Cashed Thread Pool primarily is an expandable pool, so whenever you need more tasks, more threads will be created in this pool. If there are threads that are available out of the previous tasks execution completion, then those threads can be utilized, or re-used as we say. Okay, so that's a Cashed Pool, that's another variation. And then you also have newWorkStealingPool. So, this is actually a part of the fork join implementation and fork-joined implementation is not something that we are looking at in this course, but of course if you want something of kind of fork join you should be looking at that pool. Right, in addition to the Fixed Thread pool, or maybe the Cashed Thread pool, or the…

Contents