So, i have to implement some petri nets in java and I have to use threads. The Synchronized method is pretty clear when i have to use it just once. The wait/notify method is't really clear for me, so i'm stuck. If anyone could explain it to me how should i do this it would be a really big help.
Asked
Active
Viewed 167 times
0

dawis11
- 820
- 1
- 9
- 24

Michael Ninaci
- 1
- 2
-
wait/notify is pretty low-level. You might find it more pleasant to work with [ReentrantLock](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReentrantLock.html) and [Condition](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/Condition.html). – dnault May 18 '20 at 19:45
-
@dnault ReentrantLock and Condition are even lower. – Alexei Kaigorodov May 19 '20 at 17:30