![]() |
Realm
A distributed, event-based tasking library
|
#include <event.h>
Public Types | |
| typedef ::realm_id_t | id_t |
Public Member Functions | |
| bool | operator< (const CompletionQueue &rhs) const |
| bool | operator== (const CompletionQueue &rhs) const |
| bool | operator!= (const CompletionQueue &rhs) const |
| bool | exists (void) const |
| void | destroy (Event wait_on=Event::NO_EVENT) |
| size_t | pop_events (Event *events, size_t max_events) |
| Event | get_nonempty_event (void) |
| void | add_event (Event event) |
| void | add_event_faultaware (Event event) |
Static Public Member Functions | |
| static CompletionQueue | create_completion_queue (size_t max_size) |
Public Attributes | |
| id_t | id |
Static Public Attributes | |
| static const CompletionQueue | NO_QUEUE |
A completion queue funnels the completion of unordered events into a single queue that can be queried (and waited on) by a single servicer task.
| void Realm::CompletionQueue::add_event | ( | Event | event | ) |
Add an event to the completion queue (once it triggers). non-faultaware version raises a fatal error if the specified 'event' is poisoned
| event | the event to add |
| void Realm::CompletionQueue::add_event_faultaware | ( | Event | event | ) |
|
static |
Create a completion queue that can hold at least 'max_size' triggered events (at the moment, overflow is a fatal error). A 'max_size' of 0 allows for arbitrary queue growth, at the cost of additional overhead.
| max_size | the maximum size of the queue |
| void Realm::CompletionQueue::destroy | ( | Event | wait_on = Event::NO_EVENT | ) |
Destroy a completion queue.
| wait_on | an event to wait on before destroying the queue. |
| bool Realm::CompletionQueue::exists | ( | void | ) | const |
| Event Realm::CompletionQueue::get_nonempty_event | ( | void | ) |
Get an event that, once triggered, guarantees that (at least) one call to pop_events made since the non-empty event was requested will return a non-zero number of triggered events. Once a call to pop_events has been made (by the caller of get_nonempty_event or anybody else), the guarantee is lost and a new non-empty event must be requested. Note that 'get_nonempty_event().has_triggered()' is unlikely to ever return 'true' if called from a node other than the one that created the completion queue (i.e. the query at least has the round-trip network communication latency to deal with) - if polling on the completion queue is unavoidable, the loop should poll on pop_events directly.
| bool Realm::CompletionQueue::operator!= | ( | const CompletionQueue & | rhs | ) | const |
| bool Realm::CompletionQueue::operator< | ( | const CompletionQueue & | rhs | ) | const |
| bool Realm::CompletionQueue::operator== | ( | const CompletionQueue & | rhs | ) | const |
| size_t Realm::CompletionQueue::pop_events | ( | Event * | events, |
| size_t | max_events | ||
| ) |
Requests up to 'max_events' triggered events to be popped from the queue and stored in the provided 'events' array (if null, the identities of the triggered events are discarded). This call returns the actual number of events popped, which may be zero (this call is nonblocking). When 'add_event_faultaware' is used, any poisoning of the returned events is not signalled explicitly - the caller is expected to check via 'has_triggered_faultaware' itself.
| events | the array to store the events in |
| max_events | the maximum number of events to pop |
| id_t Realm::CompletionQueue::id |
|
static |