jbarrier

edu.bonn.cs.net.jbarrier.barrier
Interface Barrier

All Known Implementing Classes:
AbstractBarrier, ButterflyBarrier, CentralBarrier, DisseminationBarrier, DoubleButterflyReduction, DoubleCentralReduction, DoubleDisseminationReduction, DoubleStaticTreeReduction, DoubleTournamentReduction, FloatButterflyReduction, FloatCentralReduction, FloatDisseminationReduction, FloatStaticTreeReduction, FloatTournamentReduction, IntButterflyReduction, IntCentralReduction, IntDisseminationReduction, IntStaticTreeReduction, IntTournamentReduction, LongButterflyReduction, LongCentralReduction, LongDisseminationReduction, LongStaticTreeReduction, LongTournamentReduction, StaticTreeBarrier, TournamentBarrier

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:

  1. await(int) has no return value.
  2. await(int) takes as a parameter the logical ID of the thread calling the method.
      With respect to logical IDs, it is assumed that, if n threads take part in the barrier, they have logical IDs ranging from 0..n-1. Each party has to know its ID and to specify it when calling 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.

      Version:
      1.0
      Author:
      Patrick Peschlow, Ivan Castilla Rodriguez

      Method Summary
       void await(int threadId)
                Called by a party that reaches the barrier.
       

      Method Detail

      await

      void await(int threadId)
      Called by a party that reaches the barrier.

      Parameters:
      threadId - the ID of the party (if n threads take part in the barrier, threadId must be one of 0..n-1)

      jbarrier

      Copyright 2010 Patrick Peschlow