Home CS439

CS439: Principles of Computer Systems

Homework 10, Part 1

Due: 8:45a Friday, April 18, 2014

Part 1 of the homeworks must be submitted electronically. Please refer to the homework turnin instructions.

  1. Describe the steps necessary to prepare a server to accept connections. How does it accept a connection?
  2. In class, we covered the idea of remote procedure calls. We discussed difficulties encountered when one attempts to implement a remote procedure call. Name the four of the difficulties. There are additional complications when the procedure executes a system call. What are the complications and how might you fix them?
    Adapted from Tanenbaum page 607.
  3. In two-phase commit, suppose the master fails after writing ``GLOBAL_COMMIT'' to disk and sending ``GLOBAL_COMMIT'' to all participating nodes but before any of the nodes receive this message. Suppose that the ``GLOBAL_COMMIT'' message reaches i of the n participants and that the participants implement a protocol in which they communicate with one another when they suspect the primary has died. What is the minimum number of participants that must receive the ``GLOBAL_COMMIT'' message to allow the participants to complete the transaction without waiting for the master to recover?
  4. Given the following piece of code:
       main(int argc, char** argv)
       {
          forkThem(5);
       }
    
       void forkThem(int n)
       {
          if(n>0)
          {
             fork();
             forkThem(n-1);
          }
       }
    

    How many processes are created if the above piece of code is run?

  5. Considering all the pieces of the operating system we have discussed, describe the steps the OS takes when performing a context switch. Assume that processes are waiting in the ready queue.