Skip to content

Commit 61203ea

Browse files
authored
Update README.md
1 parent 860d444 commit 61203ea

File tree

1 file changed

+44
-41
lines changed

1 file changed

+44
-41
lines changed

README.md

Lines changed: 44 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
# java_concurrency_algorithms
2-
Java algorithms examples using concurrency
1+
# Java Concurrent Animated - Visualizing the Java Concurrent API
2+
## A Swing Application Demonstrating Core Java Concurrency Concepts
3+
4+
Have you ever found yourself pondering how multiple threads work in Java and how to effectively utilize concepts like "notify", "notifyAll", and "wait"? Moreover, why is the usage of the "synchronized" keyword crucial in concurrent programming? Wouldn't it be amazing to witness this in action?
5+
6+
Introducing Java Concurrent Animated, a Swing application crafted by the Java Champion **[Victor Grazi](https://blogs.oracle.com/java/post/victor-grazi-java-champion)**. This program serves as an illustrative showcase of core Java Concurrency concepts, including but not limited to AtomicInteger, CountDownLatch, Semaphore, ReentrantLock, ReadWriteLock, and more.
7+
8+
```
9+
Soon link to Medium Article
10+
```
311

412
### 1. AtomicIntegerDemo
513
Description:
@@ -124,9 +132,8 @@ Description:
124132
```
125133
/**
126134
* Simple sample of Producer/Consumer using ArrayBlockingQueue (ThreadSafe)
127-
* - One Producer adds items in a pipeline in a frequency of 100ms
135+
* - One Producer adds items in a pipeline in a frequency of 200ms
128136
* - The pipeline has a limit of 5 items
129-
* - When the pipeline is full, the Producer will wait for 500ms
130137
* - Two consumers take items from the pipeline and consumes it in 500ms
131138
*/
132139
```
@@ -135,49 +142,45 @@ Description:
135142
Sample output:
136143
```console
137144
Producer is adding item1 [1/5]
138-
Consumer0 took item1
139-
Consumer1 took item2
145+
Consumer1 took item1
146+
Consumer0 took item2
140147
Producer is adding item2 [1/5]
141148
Producer is adding item3 [1/5]
142-
Producer is adding item4 [2/5]
143-
Producer is adding item5 [3/5]
144-
Producer is adding item6 [4/5]
145-
Consumer0 took item3
146-
Consumer1 took item4
147-
Producer is adding item7 [3/5]
148-
Producer is adding item8 [4/5]
149-
Producer is adding item9 [5/5]
150-
Producer queue is full
151-
Consumer0 took item5
152-
Consumer1 took item6
153-
Producer is adding item10 [4/5]
154-
Producer is adding item11 [5/5]
155-
Consumer0 took item7
156-
Consumer1 took item8
157-
Producer is adding item12 [4/5]
158-
Producer is adding item13 [5/5]
159-
Producer queue is full
160-
Consumer0 took item9
161-
Consumer1 took item10
162-
Producer is adding item14 [4/5]
163-
Producer is adding item15 [5/5]
164-
Producer queue is full
165-
Consumer0 took item11
166-
Consumer1 took item12
149+
Consumer1 took item3
150+
Producer is adding item4 [1/5]
151+
Consumer0 took item4
152+
Producer is adding item5 [1/5]
153+
Producer is adding item6 [2/5]
154+
Consumer1 took item5
155+
Consumer0 took item6
156+
Producer is adding item7 [1/5]
157+
Producer is adding item8 [2/5]
158+
Consumer1 took item7
159+
Producer is adding item9 [2/5]
160+
Consumer0 took item8
161+
Producer is adding item10 [2/5]
162+
Producer is adding item11 [3/5]
163+
Consumer1 took item9
164+
Consumer0 took item10
165+
Producer is adding item12 [2/5]
166+
Producer is adding item13 [3/5]
167+
Consumer1 took item11
168+
Producer is adding item14 [3/5]
169+
Consumer0 took item12
170+
Producer is adding item15 [3/5]
167171
Producer is adding item16 [4/5]
168-
Consumer0 took item13
169-
Consumer1 took item14
172+
Consumer1 took item13
173+
Consumer0 took item14
170174
Producer is adding item17 [3/5]
171175
Producer is adding item18 [4/5]
172-
Producer is adding item19 [5/5]
173-
Producer queue is full
174-
Consumer0 took item15
175-
Consumer1 took item16
176+
Consumer1 took item15
177+
Producer is adding item19 [4/5]
178+
Consumer0 took item16
176179
Producer is adding item20 [4/5]
177-
Consumer0 took item17
178-
Consumer1 took item18
179-
Consumer0 took item19
180-
Consumer1 took item20
180+
Consumer1 took item17
181+
Consumer0 took item18
182+
Consumer1 took item19
183+
Consumer0 took item20
181184
```
182185
### 7. ForkJoinRecursiveTaskDemo
183186
Description:

0 commit comments

Comments
 (0)