SPE event handling

In a multithreaded environment, it is often convenient to use an event mechanism for asynchronous notification. A common use is that the main thread sets up an event handler to receive notification about certain events caused by the asynchronously running SPE threads, see spe_event_handler_create and spe_event_handler_register. It then uses an event loop to wait for events, using spe_event_wait, and performs appropriate actions in response.

The library supports events to indicate that an SPE has stopped execution, mailbox messages have been written or read by an SPE, or PPE-initiated DMA operations have completed. In order to obtain details associated with the event, the application has to perform a separate action, for example, call spe_stop_info_read to obtain the full information on the stop reason for an SPE context, call spe_out_intr_mbox_read to actually read the message from the SPE mailbox, or call spe_mfcio_tag_status_read to know which tag groups completed.