ChibiOS/RT Logo ChibiOS/RT

Architecture - Reference Manual - Guides

Events Explained

Events are an important feature in ChibiOS/RT, most device drivers generate events in order to notify the application that something happened at the I/O level.
While event flags are not something unknown in other operating systems, their peculiar implementation in ChibiOS/RT requires a more in depth explanation.
Lets start with the events related terminology:

Note that events are asynchronously generated, as example in an interrupt handler, but are synchronously served.

Events related data structures

The following diagram explains the relationship between an event source, its list of event listeners and the registered threads.

inline_dotgraph_11.dot

Note that each event listener has a different bit mask to be pended on its associated thread when the event source is broadcasted, this means that each thread can define its own event identifiers independently. A broadcast operation can also pend more than one bit on the registered threads.
The threads have a variety of wait primitives, they can wait for one or more event flags to become pending, and can also specify AND/OR conditions, as example a thread can wait for any event to become pending or wait for all the specified events to become pending.
The field p_epending is the mask of the currently pending events, the field p_ewmask is the mask of the events the thread is interested on in that moment (AND or OR condition depending on the invoked wait API).

Use Scenarios

Events are best used when one of more of the following conditions are required:


Generated on Sun Nov 28 2010 14:09:55 for ChibiOS/RT by doxygen 1.7.1