Fixed Thread Pool
Executors.newFixedThreadPool(size).Cached Thread Pool
Executors.newCachedThreadPool().Scheduled Thread Pool
Executors.newScheduledThreadPool(size).Single Threaded Executor
Executors.newSingleThreadExecutor().In the next video, the focus will be on using constructors to customize thread pool parameters.
0:00 so Java provides four kinds of tadpoles first is a fixed thread pool which we saw earlier second is the cash thread pool third is scheduled thread pool and pour the single threaded executed so first one the fixed thread pool is exactly the one that we saw earlier wherein it has fixed number of threads which in this case is T 0 to t 9 so 10 threads and you keep submitting the tasks to it all the tasks that you submit are stored in a particular Q that Q has to be thread saved so typically
0:31 it's a blocking cube and all these threads will fetch tasks from the queue and execute it one after the other and the code for it is also what we saw earlier you do executors start new fix that pool you give it the size of the pool and you submit the tasks using the for loop or otherwise the next type of thread pool is slightly different here you do not have a fixed number of threads and you also do not have a queue
1:03 which will hold the number of tasks that you submitted instead the Q is replaced by something called synchronous Q which has only space for a single idle so every time you submit a particular task the pool will hold that task in this location and it will search for any of the threads which are already created and which are free to operate or execute that task if no such thread is
🔒 The full, searchable transcript is available with Pro.