Homework 12 Solutions

22C:116, Fall 1998

Douglas W. Jones
  1. Part A: The call by the UNIX kernel to a user's signal handler is an example of a callback in UNIX.

    Part B: An interrupt service routine can be viewed as an operating system function called by hardware. The hardware itself can be considered to be at a lower level in the hierarchic system design than the operating system, so the call to the interrupt service routine can be viewed as a callback.

    Part C:

    	cb()
    	/* callback; called from nbwrite */
    	{
    		signal(fsem)
    	}
    
    	thwrite(f,buf,len)
    	/* thread user calls this instead of blocking write */
    	{
    		nbwrite(f,buf,len,cb)
    		thread_wait(fsem)
    	}
    
  2. Distributed file systems offer such possibilities as file replication across many servers, huge files that span multiple servers, and directory entries on one server referring to files stored on diffent servers. These options are not normally provided by systems containing multiple conventional file servers.

  3. Part A: In the context of DEMOS MP, the clients of the name server used to handle process migration are the kernels on machines where users sent messages to processes that have migrated.

    Part B: Access to a name-server can become a bottleneck as a system grows. If each kernel maintains local copies of forwarding addresses for T time units after a process has migrated away from that kernel, then increasing the value of T will reduce the reliance on the name-server, while reducing the value of T will increase the use on the name-server.