Advertisement
Guest User

Untitled

a guest
May 14th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. bool Run = true;
  2. Barrier  BarrierObj(ThreadMax);
  3.  
  4. void ParallelFunction()
  5. {
  6.     Barrier::Tracer TracerObj = BarrierObj.GetTracer();
  7.  
  8.     do
  9.     {
  10.         BarrierObj.Set(TracerObj);
  11.         //alle threads arbeiten
  12.  
  13.         if (BarrierObj.Set(TracerObj) == 0)
  14.         {
  15.             //ein thread arbeitet
  16.         }
  17.  
  18.         BarrierObj.Set(TracerObj);
  19.         //alle threads arbeiten
  20.     }
  21.     while (Run);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement