2 ms·
Honestly the fact that a thread is even waiting for a map value to be filled in is a bit of a red flag. 99% of multithreaded code should be using channels or pa
by IshKebab 2y ago
Honestly the fact that a thread is even waiting for a map value to be filled in is a bit of a red flag. 99% of multithreaded code should be using channels or parallel for/map.
If you have to have a thread wait for a value from another then use a condition variable like he said.
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/locks/Condition.html https://docs.oracle.com/javase/8/docs/api/java/util/concurre...