| Quiz | Posted | Given in class | ||
|---|---|---|---|---|
| 10 | Apr | 22 | Apr | |
A set of n Threads participates in a barrier synchronization as follows.
Barrier object is constructed as follows:
Barrier b = new Barrier(n);
b.atBarrier()
Semaphore.
Write the code for the Barrier class using Semaphore objects
and no other synchronization mechanisms (i.e., no wait,
no synchronized, etc).