In hierarchical software system designs, the term callback is used to refer to cases where lower levels call procedures or functions in higher levels.
Part A: Give an example of a callback in the context of the UNIX operating system.
Part B: Discuss the relationship between callbacks and interrupts.
Part C: In the discussion of kernel support for user-level threads, one option suggested was to replace kernel services that would normally block with nonblocking variants that use a callback to signal that the operation is complete. Thus, for example, we replace the blocking UNIX kernel service write(f,buf,len) with a new service nbwrite(f,buf,len,cb). This new service calls the callback cb as soon as the write completes.
Consider our example thread package. Write code for thwrite(f,buf,len) that behaves as a blocking write operation, but blocks only the calling thread instead of blocking all of the threads in the user process. You may assume that there is always some other ready thread if this simplifies your design.
Part A: In the context of DEMOS MP, who are the clients for this name server?
Part B: Access to a name-server can become a bottleneck as a system grows. Discuss the effect of changing the value of T on this problem.