Skip to content

Commit b879180

Browse files
committed
Added Thread Pool description.
1 parent df4b536 commit b879180

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi
6565
Concurrency patterns are those types of design patterns that deal with the multi-threaded programming paradigm.
6666

6767
* [Double Checked Locking](#double-checked-locking)
68+
* [Thread Pool](#thread-pool)
6869

6970
### Presentation Tier Patterns
7071

@@ -601,6 +602,14 @@ validation and for building to order
601602
**Applicability:** Use the Resource Acquisition Is Initialization pattern when
602603
* You have resources that must be closed in every condition
603604

605+
## <a name="thread-pool">Thread Pool</a> [&#8593;](#list-of-design-patterns)
606+
**Intent:** It is often the case that tasks to be executed are short-lived and the number of tasks is large. Creating a new thread for each task would make the system spend more time creating and destroying the threads than executing the actual tasks. Thread Pool solves this problem by reusing existing threads and eliminating the latency of creating new threads.
607+
608+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/thread-pool/etc/thread-pool.png "Thread Pool")
609+
610+
**Applicability:** Use the Thread Pool pattern when
611+
* You have a large number of short-lived tasks to be executed in parallel
612+
604613

605614

606615
# Frequently asked questions

0 commit comments

Comments
 (0)