Commit 55c0dbc
committed
docs(concurrency): add explanation of why thread pooling is used in Java
WHAT was added:
- Detailed notes on the advantages of thread pooling in concurrent programming.
- Covered the following key benefits:
1. Resource Management → avoids costly thread creation/destruction overhead.
2. Faster Response Time → pre-initialized threads reduce task latency.
3. Control Over Thread Count → prevents resource exhaustion by limiting threads.
4. Avoids Thread Overhead → minimizes context switching, optimizes CPU utilization.
5. High-Concurrency Use Cases → ideal for servers, DB connections, real-time apps.
WHY this matters:
- Provides clear justification for using thread pools instead of raw threads.
- Highlights performance, scalability, and stability improvements.
- Prepares foundation for deeper topics like ExecutorService, ScheduledExecutorService, and custom thread pools.
HINTS / NEXT STEPS:
- Add examples using `Executors.newFixedThreadPool()` and `newCachedThreadPool()`.
- Compare pooling strategies (fixed vs cached vs scheduled vs single-threaded).
- Show performance difference with and without pooling via a small benchmark.
KEYWORDS:
java threadpool concurrency executors performance scalability.
Signed-off-by: https://github.com/Someshdiwan <[email protected]>1 parent 4cfd8a4 commit 55c0dbc
File tree
1 file changed
+1
-1
lines changed- Section19MultiThreading/ThreadPooling/src
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
0 commit comments