receiver tid: look up receiver - not in ReceiveWait
sender blocks (Ready → SendWait)
where to store information about senders? at receiver
T2 Receive
finds sender - sanity check for SendWait
sender still blocked (SendWait → ReplyWait)
kernel copies data
T2 still Ready
Send/Receive Scenario 2: Receive first
T1 Receive
no sender found
receiver blocks (Ready → ReceiveWait)
store receive-blocked tasks in kernel container? only for cleanup/housekeeping
T2 Send
receiver tid: look up receiver - in ReceiveWait
unblock receiver (ReceiveWait → Ready)
block sender (Ready → ReplyWait)
kernel copies data
Reply
non-blocking: sender must be waiting
sender tid: look up sender - sanity check for ReplyWait
unblock sender (ReplyWait → Ready)
kernel copies data
Receive and Reply can be decoupled
in time: sender parked until later reply (reordering)
in space: different task replies than original receiver (delegation)
kernel provides SRR functionality
provide mechanisms for blocking senders and/or receivers
message copying for safe asynchronous operation of sender & receiver
direct copy from sender to receiver and vice versa
no message buffering in kernel
kernel must also set return codes appropriately
messages: structured data
no conversion (marshalling) needed as in heterogeneous distributed systems
copied as byte (char) array
type-checking: verify type of message for type of task?
want global type field per message?
Server Pattern
background: reasoning about latency of critical code paths - do not block!
design system to control latencies!
server provides service to clients
a) receive request
b) process
c) (delayed) response
→ server always available or working: never blocks
never calls Send() or AwaitEvent()
SRR for Producer/Consumer
communication pattern; asynchronous buffering; control blocking
single producer, single consumer (SPSC)
producer sends, consumer responds with ack: "push" communication
consumer sends/requests, producer responds with element: "pull" communication