Topic
1 reply Latest Post - ‏2010-07-12T23:23:40Z by jadamcze
PedroGonnet
PedroGonnet
12 Posts
ACCEPTED ANSWER

Pinned topic Does spe_in_mbox_write yield on SPE_MBOX_ALL_BLOCKING?

‏2010-07-12T23:08:46Z |
Simple question actually... If I've got a thread on the PPU that calls spe_in_mbox_write(...,SPE_MBOX_ALL_BLOCKING), and the mbox of the SPU is full, does the calling thread yield or just spin?

If it does not yield, how bad would it be to do the following

while ( !spe_in_mbox_status( myspe ) )
sched_yield();
spe_in_mbox_write( myspe , ... , SPE_MBOX_ALL_BLOCKING );

Is there, perhaps, a more elegant solution?

Cheers, Pedro
Updated on 2010-07-12T23:23:40Z at 2010-07-12T23:23:40Z by jadamcze
  • jadamcze
    jadamcze
    219 Posts
    ACCEPTED ANSWER

    Re: Does spe_in_mbox_write yield on SPE_MBOX_ALL_BLOCKING?

    ‏2010-07-12T23:23:40Z  in response to PedroGonnet
    From the source of the function (libspe2/spebase/mbox.c) it appears that the blocking modes use the poll() system call to wait until writing to the relevant spufs file will not block. There is no need to manually loop in the way you've suggested.