Barrelfish
Functions
event_queue.c File Reference

Event queue implementatino. More...

Functions

void event_queue_init (struct event_queue *q, struct waitset *waitset, enum event_queue_mode mode)
 Initialise a new event queue. More...
 
void event_queue_add (struct event_queue *q, struct event_queue_node *qn, struct event_closure event)
 Add a new event to an event queue. More...
 
errval_t event_queue_cancel (struct event_queue *q, struct event_queue_node *qn)
 Cancel an event previously added to an event queue. More...
 
errval_t event_queue_flush (struct event_queue *q)
 Flush all pending events from the event queue. More...
 
errval_t event_queue_trigger (struct event_queue *q)
 Trigger the next event on a queue which is operating in one-shot mode. More...
 

Detailed Description

Event queue implementatino.

This code implements a thread-safe queue of pending events which are serviced by a single waitset.

[!] WARNING: current realization of event queues is unsuitable for cross-core operation. Crux of the issue: trigger channel for waitset belonging to another core but waitsets are assumed to be local to a dispatcher.

Example scenario:

For further details see: https://lists.inf.ethz.ch/mailman/private/barrelfish/2013/002746.html

Function Documentation

void event_queue_add ( struct event_queue *  q,
struct event_queue_node *  qn,
struct event_closure  event 
)

Add a new event to an event queue.

Parameters
qEvent queue
qnStorage for queue node (uninitialised)
eventEvent closure
errval_t event_queue_cancel ( struct event_queue *  q,
struct event_queue_node *  qn 
)

Cancel an event previously added to an event queue.

Parameters
qEvent queue
qnQueue node which was previously added to #q by event_queue_add()
errval_t event_queue_flush ( struct event_queue *  q)

Flush all pending events from the event queue.

Parameters
qEvent queue.
void event_queue_init ( struct event_queue *  q,
struct waitset waitset,
enum event_queue_mode  mode 
)

Initialise a new event queue.

Parameters
qStorage for event queue
waitsetWaitset that will service the queue
modeOperating mode for the queue
errval_t event_queue_trigger ( struct event_queue *  q)

Trigger the next event on a queue which is operating in one-shot mode.

Must not be called before the previously-triggered event has run.

Parameters
qEvent queue