Загрузка страницы

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
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
24 ноября 2020 г. 13:00:45
00:18:04
Яндекс.Метрика