Hacker News new | ask | show | jobs
by giu 1963 days ago
A 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/concurre...