CS 537 Notes, Section #9: Message Systems


Nothing in OSTEP on this topic. There is coverage of this topic in in Silberschatz's Operating Systems Concepts, Chapter 3, Sections 3.4.2 and pages 148-150

Up until now, discussion has been about communication using shared data. Messages provide for communication without shared data. One process or the other owns the data, never two at the same time.

This kinds of communication is used heavily in the parallel programming community (with MPI).

Message = a piece of information that is passed from one process to another.

Mailbox = a place where messages are stored between the time they are sent and the time they are received.

Operations:


Send/Receive

Is there really no shared data?

There are two general styles of message communication:

Producer & consumer example:

Producer Consumer
int buffer1[1000];

while (1) {

    -- prepare buffer1 --
    mbox.send(buffer1);

};
int buffer2[1000];

while (1) {

    mbox.receive(buffer2);
    -- process buffer2 --

};

Note that buffer recycling is implicit, whereas it was explicit in the semaphore implementation.

Client & Server example:

Client Server
int buffer1[1000];

mbox1.send("read rutabaga");
mbox2.receive(buffer);
int buffer2[1000];
int command[1000];

mbox1.receive(command);
-- decode command --
-- read file into buffer2 --
mbox2.send(buffer2);

Note that this looks a lot like a procedure call and return. Explain the various analogs between procedure calls and message operations:

Why use messages?

Which is more powerful, messages or monitors?

Message systems vary along several dimensions:

How would the following systems fall into the above classifications?



Copyright © 2013, 2018 Barton P. Miller
Non-University of Wisconsin students and teachers are welcome to print these notes their personal use. Further reproduction requires permission of the author.