Commit 0c48505
committed
feat: add BlockingQueueWorkingThreadSafe demonstrating producer-consumer pattern and thread-safe queues
Implemented BlockingQueueWorkingThreadSafe.java to showcase how BlockingQueue ensures
safe communication between producer and consumer threads using put() and take().
Includes examples of ArrayBlockingQueue, LinkedBlockingQueue, PriorityBlockingQueue,
and SynchronousQueue with concurrency characteristics and blocking behavior explained.
Signed-off-by: https://github.com/Someshdiwan <[email protected]>1 parent a57f07a commit 0c48505
File tree
1 file changed
+8
-7
lines changed- Section 25 Collections Frameworks/Queue Interface/Blocking Queue/src
1 file changed
+8
-7
lines changedLines changed: 8 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
61 | | - | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 68 | + | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | | - | |
97 | | - | |
98 | 99 | | |
0 commit comments