Motr
M0
|
The circular queue is defined by the nlx_core_bev_cqueue data structure.
Subroutines are provided to:
The nlx_core_bev_cqueue provides access to the producer and consumer elements in the circular queue.
In addition, semaphores or other synchronization mechanisms can be used to notify the producer or consumer when the queue changes, eg. when it becomes not empty.
The circular queue is initialized as follows:
The event queue can be expanded to make room for additional buffer events. This should be performed before buffers are queued. One element should exist on the event queue for each expected buffer operation, plus one additional element for the "current" buffer operation.
The (single) producer works in a loop, putting event notifications in the queue:
The (single) consumer works in a loop, consuming data from the queue: