Thread Pools and the Executor Framework in Java

preview_player
Показать описание
Most of the executor implementations use thread pools to execute tasks. A thread pool is nothing but a bunch of worker threads that exist separately from the Runnable or Callable tasks and is managed by the executor. Creating a thread is an expensive operation and it should be minimized.
Рекомендации по теме
Комментарии
Автор

If we specify a pool size of 10, will it have max 10 threads can be created or would be running at a given time? 11th thread can we not able able to create?

swathikoochi
Автор

Thanks for the explanation. Why sometimes runs the Thread1 first and sometimes Thread2? Thanks.

designanimation