Homework I Due Date: Monday, October 27, 1997 (before start of class) 1. Blocking system calls are problematic with user-level threads because the blocking of one thread also blocks other threads that run on the same kernel thread. The first class user-level threads system addresses this problem by allowing control to return to the user level when a thread making a system call blocks inside the kernel. Assume t1 and t2 are two user level threads that run on the same kernel thread. Explain how the first class user-level threads system transfers control to t2 when t1 blocks inside the kernel. Your answer should enumerate the steps executed in transferring control to t2 and the data structures accessed by the code executed by these steps. Also, describe where the data structures are allocated (user or kernel space) and how are they initialized. 2. Assume that we want to associate priorities with threads in the preemptive scheduler that you have built in the second project. A new call, setpriority(i: integer) is added to the library that allows a thread to set its priority between 0 and 10. The thread having the highest priority should be run next when the current thread gives up control of the processor. Describe how the Mythread_yield() function can be modified to implement priority based scheduling. For full credit, provide pseudo code for this function using setjmp() and longjmp(). 3. In the first programming assignment, a memory allocator (with variable size requests) was implemented using lock and condition synchronization variables. Provide pseudo code for such a memory allocator when it is implemented as a monitor. You should explain how you exploit the functionality provided by a monitor to synchronize threads that request and release memory from the shared buffer pool. 4. The implicit dequeue() call in serializers corresponds to the explicit signal() call on condition variables in monitors. Describe how these calls are implemented and comment on the efficiency of their implementation. Based on this comparison, can one claim that monitors can be implemented more efficiently than serializers? 5. Two delay based implementations are suggested for spin locks in the Anderson et. al. paper. Which implementation will you choose for a non-uniform memory access (NUMA) architecture. Explain your answer.