|
jbarrier | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Barrier
Interface for all barrier implementations of this package. A barrier is a
well-known synchronization construct for two or more parties (here: threads).
No party may pass the barrier until all other parties have arrived at the
barrier. Only then the next phase of parallel computation is started.
A party reaches the barrier by calling the await(int)
method. There
are two differences between await(int)
and the corresponding method
of the CyclicBarrier
:
await(int)
has no return value.
await(int)
takes as a parameter the logical ID of the thread
calling the method.
await(int)
.
There are ways to implement the same behavior without having to specify a
logical ID, but we think our current implementation doesn't cause any
inconvenience to the user.
Method Summary | |
---|---|
void |
await(int threadId)
Called by a party that reaches the barrier. |
Method Detail |
---|
void await(int threadId)
threadId
- the ID of the party (if n threads take part in the
barrier, threadId must be one of 0..n-1)
|
jbarrier | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |