[ ] Communication via mailboxes (or ports)
[ ] Processes communicate by putting and taking messages in/from mailboxes
– send(A, m) and receive(A,m)
[ ] Properties of communication link
– A link is established between two processes, if they share a mailbox
– Link maybe associated with more than two processes
– A number of different links may exist between any pair of processes; each one a separate mailbox
SYNCHRONIZATION
- - - is timekeeping which requires the coordination of events to operate a system in unison. The familiar conductor of an orchestra serves to keep the orchestra in time. Systems operating with all their parts in synchrony are said to be synchronous or in sync. Some systems may be only approximately synchronized, or plesiochronous. For some applications relative offsets between events need to be determined, for others only the order of the event is important. - - -
[ ] BLOCKING SEND – sender blocked until message is received by receiver (or by mailbox)
[ ] NON - BLOCKING SEND – sending process resumes operation right after sending
[ ] BLOCKING RECEIVE – receiver blocks until message is available
[ ] NON - BLOCKING RECEIVE – receiver retrieves a valid message or returns an error code
BUFFERING
[ ] Zero capacity – queue has length 0, no messages can be outstanding on link, sender blocks for
message exchange
[ ] Bounded capacity – queue has length N, N messages can be in queue at any point in time, sender blocks if queue is full, otherwise it may continue to execute
[ ] Unbounded capacity – queue has infinite length, sender never blocks
PRODUCER COUNTER EXAMPLE
[ ] PRODUCER – generates an integer between 0 and 9 (inclusive), then stores it in a CubbyHole object. To make the synchronization problem more interesting, the Producer sleeps for a random amount of time between 0 and 100 milliseconds before repeating the number generating cycle.
[ ] CONSUMER – consumes all integers from the CubbyHole (the exact same object into which the Producer put the integers in the first place) as quickly as they become available.