[Cbe-oss-dev] [PATCH 1/5] MARS: yield in workload queue wait busy loop

Arnd Bergmann arnd at arndb.de
Sat Jul 19 01:33:26 EST 2008


On Wednesday 16 July 2008, Kazunori Asayama wrote:

> I suppose your mailbox method doesn't work in MARS case.
> 
> First, a MARS task can be loaded into any of SPE contexts in a MARS
> runtime environment (MARS context) by the MARS kernel, and by MARS task
> switching, the MARS task can move to another SPE context. That is, a PPE
> thread which is waiting for the sync object can't determine whose 
> mailboxes the PPE thread should read (...and MARS task switching can 
> occure while the PPE thread is blocking at read operation on the mailboxes).
> 
> Second, if multiple synchronization objects are used by one MARS task
> and separate PPE threads wait for each of the sync objects, the 
> mailboxes of the SPE context corresponding to the MARS task can be 
> accessed by the multiple PPE threads at the same time. So a notification 
> for one of the sync objects may received by an unexpected PPE thread.
> 
> These were reasons why I thought a kind of dispatcher would be needed.

Yes, that makes sense. As we conlcluded earlier, the mailbox can only be
used for communication between the MARS kernel and the PPE (or other
MARS kernels on other SPEs). If you want to communicate between a task
running in MARS and a thread on the PPE (or another task running in
MARS), you either need a dispatcher, or should use the futex method.

	Arnd <><




More information about the cbe-oss-dev mailing list