[Cbe-oss-dev] [PATCH 1/5] MARS: yield in workload queue wait busy loop
Arnd Bergmann
arnd at arndb.de
Wed Jul 16 02:06:38 EST 2008
On Tuesday 15 July 2008, Kazunori Asayama wrote:
> MARS assumes (near) realtime and/or interactive applications, so
> synchronization functions tend to be frequently called. Thus we'd like
> to avoid stopping an SPE(SPU syscall causes stop&signal) when
> synchronization objects are used. Instead, if the SPE stalls on
> synchronization, MARS implicitly switches to another runnable MARS task
> without stopping the SPE, so that the SPE's usage increases. In the
> other words, this behavior is one of major advantages of MARS.
>
> This is the reason why we choosed memory based synchronization for MARS.
> Do you have any suggestion?
What you describe is one of the features of futexes: When you use them
with atomic updates (load-locked/store-conditional), you only need to
do a system call if there are other threads that are waiting or that
you need to wait for.
Another option would be to use the mailboxes for asynchronous communication
from the SPU to the PPU. In the fast path, you can normally use simple
memory accesses, but if you think the other PPU might be blocking, the SPU
has to write to the interrupt mailbox, so that the PPU can do a blocking
read on it.
Arnd <><
More information about the cbe-oss-dev
mailing list