Next: Concurrency primitives using events
Up: Intra-domain scheduling
Previous: Intra-domain scheduling
There are three operations available on an event count e and two
on a sequencer s. These are:
- read(e)
- This returns the current value of the event count
e. More strictly this returns some value of the event count
between the start of this operation and its termination.
- await(e,v)
- This operation blocks the calling thread until the
event count e reaches or exceeds the value v.
- advance(e,n)
- This operation increments the value of event count
e by the amount n. This may cause other threads to
become runnable.
- read(s)
- This returns the current value of the sequencer
s. More strictly this returns some value of the sequencer
between the start of this operation and its termination.
- ticket(s)
- This returns the current member of a monotonically
increasing sequence and guarantees that any subsequent calls to either
ticket or read will return a higher value.
In fact there is little difference between the underlying semantics of
sequencers and event counts; the difference is that the ticket
operation does not need to consider awaking threads, whereas the
advance operation does (therefore it is wrong for a thread to
await on a sequencer). The initial value for sequencers and event
counts is zero; this may be altered immediately after creation using
the above primitives. An additional operation
await_until(e,v,t) is supported, which waits until event e has
value v or until time has value t.
By convention an advance on an outbound event will cause the new
value to be propagated by issuing the send() system call. Only
read and await should be used on incoming events as their
value may be overwritten at any time.
In this way, both local and interdomain synchronization can be
achieved using the same interface and, unless required, a user level
thread need not concern itself with the difference.
Next: Concurrency primitives using events
Up: Intra-domain scheduling
Previous: Intra-domain scheduling
I. Leslie, D. McAuley, R. Black, T. Roscoe, P. Barham, D. Evers, R. Fairbairns & E. Hyden