Thread Pools in Java

Veröffentlicht am: 01 Januar 1970
auf dem Kanal: Jakob Jenkov
67,929
1.5k

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-conc...

Java ExecutorService Tutorial (built-in Java Thread Pool) - text:
http://tutorials.jenkov.com/java-util...

Java Concurrency Playlist:
   • Java Concurrency and Multithreading  


Auf dieser Seite können Sie das Online-Video Thread Pools in Java mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Jakob Jenkov 01 Januar 1970 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 67,929 Mal angesehen und es wurde von 1.5 tausend den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!