Thread Pools in Java
A Thread Pool is an alternative to creating a new thread per task to execute. Instead, a number of pre-created threads exist in a pool - into which you can submit tasks to be executed by these pooled threads. New tasks submitted to the pool are first stored internally in a queue. From this queue the pooled threads will take the tasks and execute them. Each thread in the thread pool executes in a loop that takes a new task from the internal task queue in the thread pool (or block if no tasks are available), executes the task, and then tries to take another task etc. repeatedly. In this thread pool tutorial I explain in more detail how thread pools work, and show a thread pool implementation in Java. To access the code, click on the link to the textual version of this thread pool tutorial.
Chapters:
0:00 Thread Pool Introduction
1:49 Thread Pool Load Balancing Between Threads
3:00 Using the implemented Thread Pool - ThreadPool
6:48 The Implementation of the ThreadPool class.
12:10 The Implementation of the ThreadPoolRunnable class.
16:12 Summary of use of the ThreadPool implementation.
Thread Pool Tutorial - text:
http://tutorials.jenkov.com/java-concurrency/thread-pools.html
Java ExecutorService Tutorial (built-in Java Thread Pool) - text:
http://tutorials.jenkov.com/java-util-concurrent/executorservice.html
Java Concurrency Playlist:
https://www.youtube.com/playlist?list=PLL8woMHwr36EDxjUoCzboZjedsnhLP1j4
Видео Thread Pools in Java канала Jakob Jenkov
Chapters:
0:00 Thread Pool Introduction
1:49 Thread Pool Load Balancing Between Threads
3:00 Using the implemented Thread Pool - ThreadPool
6:48 The Implementation of the ThreadPool class.
12:10 The Implementation of the ThreadPoolRunnable class.
16:12 Summary of use of the ThreadPool implementation.
Thread Pool Tutorial - text:
http://tutorials.jenkov.com/java-concurrency/thread-pools.html
Java ExecutorService Tutorial (built-in Java Thread Pool) - text:
http://tutorials.jenkov.com/java-util-concurrent/executorservice.html
Java Concurrency Playlist:
https://www.youtube.com/playlist?list=PLL8woMHwr36EDxjUoCzboZjedsnhLP1j4
Видео Thread Pools in Java канала Jakob Jenkov
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Java ExecutorService - Part 1 - IntroductionThe Java Memory Model - The BasicsMultithreading in Java Explained in 10 MinutesConcurrency vs ParallelismJava Concurrency Interview - What is an Ideal Threadpool size?Java ExecutorService - Part 1Java Synchronized - The synchronized keyword in Java and Java synchronized blocks and methodsJava Memory Model in 10 minutesJava Interview Questions and AnswersSemaphore in Java ConcurrencyThread Pools and the Executor Framework in JavaJava multithreading 🧶Java BlockingQueueJava threads 🧵Java ThreadLocalJava Concurrency Interview Question: How to timeout a thread?Thread Safety in JavaJava ExecutorService - Part 2 - Type of Pools