Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Run = true;
- Barrier BarrierObj(ThreadMax);
- void ParallelFunction()
- {
- Barrier::Tracer TracerObj = BarrierObj.GetTracer();
- do
- {
- BarrierObj.Set(TracerObj);
- //alle threads arbeiten
- if (BarrierObj.Set(TracerObj) == 0)
- {
- //ein thread arbeitet
- }
- BarrierObj.Set(TracerObj);
- //alle threads arbeiten
- }
- while (Run);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement