3 ms·
What's the difference with a semaphore?
by varajelle 6y ago
What's the difference with a semaphore?
- giu 6y agoA semaphore can be used to control thread access to a resource. A latch allows one or more threads to wait until a set of operations being performed in other threads completes [0]. [0] https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html https://docs.oracle.com/javase/8/docs/api/java/util/concurre...
- magicalhippo 6y agoA semaphore allows threads to pass until the counter reaches zero. A barrier (what this thing is) blocks threads until the counter reaches zero.