IPC, Nachos

Tom Kelliher, CS42

Sept. 20, 1996

IPC Mechanisms

Basics: send(), receive() primitives.

Design Issues:

  1. Link establishment mechanisms:
    1. Direct or indirect naming.

    2. Circuit or no circuit.

  2. More than two processes per link (multicasting).

  3. Link buffering:
    1. Zero capacity.

    2. Bounded capacity.

    3. Infinite capacity.

  4. Variable- or fixed-size messages.

  5. Unidirectional or bidirectional links (symmetry).

  6. Resolving lost messages.

  7. Resolving out-of-order messages.

  8. Resolving duplicated messages.

Mailboxes --- An Indirect Communication Mechanism

Resources owned by kernel.

Messages kept in a queue.

Assume:

  1. Only allocating process may execute receive.

  2. Any process (including ``owner'') may send.

  3. Variable-sized messages.

  4. Infinite capacity.

Primitives:

  1. int AllocateMB(void)

  2. int Send(int mb, char* message)

  3. int Receive(int mb, char* message)

  4. int FreeMB(int mb)

Example: Process Synchronization

Consider:

Process1()
{
   ...
   S1;
   ...
}

Process2()
{
   ...
   S2;
   ...
}
How can we guarantee that S1 executes before S2?

Example: Tape Drive Allocation and Use

The situation:

Tape allocator process:

initialize();
while (1)
{
   Receive(Tamb, message);
   if (message is a request)

      if (there are enough tape drives)

         for each tape drive being allocated
         {
            fork a handler daemon;
            send daemon mb # in message to requesting process;
            update lists;
         }

      else

         send a rejection message;

   else if (message is a return)
   {
      update lists;
      send an ack message;
   }

   else

      ignore illegal messages;
}

Summary of user process actions:

  1. Send request to tape allocator.

  2. Receive message back giving mailbox(es) to use in communicating with tape drive(s).

  3. Start sending/receiving with tape drive daemon(s).

  4. Close tape drives.

  5. Send message to tape allocator returning tape drive(s).

Nachos

  1. On-line info: http://http.cs.berkeley.edu/~tea/nachos/.

  2. Root of Nachos source tree: ~kelliher/pub/cs42/nachos-3.4/.

  3. Use a recursive copy to make one copy.

  4. nachos group: allows you to share your work.

  5. Do a recursive chown to make the group nachos for the source tree.

  6. Before each editing session be sure to do the following:
    lisp% umask 7
    

  7. Places to find documentation; printing and viewing Postscript files.



Thomas P. Kelliher
Thu Sep 19 17:55:49 EDT 1996
Tom Kelliher