| Iris Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
IrisArbiter;
IrisReceiver* iris_arbiter_receive (IrisScheduler *scheduler,
IrisPort *port,
IrisMessageHandler handler,
gpointer user_data,
GDestroyNotify notify);
IrisArbiter* iris_arbiter_coordinate (IrisReceiver *exclusive,
IrisReceiver *concurrent,
IrisReceiver *teardown);
IrisArbiter provides a way to control how messages can be
received. The simple arbiter, created using iris_arbiter_receive()
does nothing to control when messages can be received. Messages
will be processed as fast as the scheduler can handle them.
Alternatively, the coordination-arbiter can be used with
iris_arbiter_coordinate(). The coordination-arbiter is similar to
a reader-writer lock implemented asynchronously.
IrisReceiver* iris_arbiter_receive (IrisScheduler *scheduler, IrisPort *port, IrisMessageHandler handler, gpointer user_data, GDestroyNotify notify);
Creates a new IrisReceiver instance that executes callback when a message
is received on the receiver. Note that if you attach this to an arbiter,
a message posted to port may not result in callback being executed right
away.
If not NULL, notify will be called when the receiver is destroyed.
|
An IrisScheduler or NULL
|
|
An IrisPort |
|
|
|
data for callback
|
|
A GDestroyNotify or NULL
|
Returns : |
the newly created IrisReceiver instance |
IrisArbiter* iris_arbiter_coordinate (IrisReceiver *exclusive, IrisReceiver *concurrent, IrisReceiver *teardown);
Coordinates messages incoming to the receivers. This is used to guarantee semantics for the receivers.
Any message received on the exclusive receiver is guaranteed to be the
only message received at a time. No other exclusive, concurrent, or
teardown messages will be running.
Messages received on the concurrent receiver can be received concurrently
meaning more than one message is allowed to be received at a time.
Only one message can be recieved on teardown ever. After a message has
been received on teardown, no further messages will ever be received
on any receivers.
|
An IrisReceiver |
|
An IrisReceiver |
|
An IrisReceiver |
Returns : |
An new IrisArbiter that will arbitrate messages incoming to the passed receivers. |