[Cbe-oss-dev] [PATCH 4/10] MARS: task barrier fix notify

Kazunori Asayama asayama at sm.sony.co.jp
Fri Aug 29 16:10:13 EST 2008


Yuji Mano wrote:
> Kazunori Asayama wrote:
>> If you reset the barrier count here, mars_task_barrier_wait after
>> barrier.count becomes equal to barrier.total, will cause deadlock.
>>
>> For example:
>>
>>   mars_task_barrier_initialize(barrier, 1);
>>   mars_task_barrier_notify(barrier); // this call increments the barrier
>>                                      // count, then resets it.
>>   mars_task_barrier_wait(barrier); // this call will block forever.
> 
> Yes you are right.
> Which means that the barrier must be reset when all tasks have called
> mars_task_barrier_wait().

Right.

> 
> So I guess it will be a requirement for all tasks in the barrier to call both
> notify and wait in a pair? That is...you cannot have a single notifier task
> with multiple other tasks waiting?

As you say, I assume # of notify == # of wait.

-- 
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list