CS414, Fall 2005 Homework 2 Posted 9/6/05 Remember, do not turn in your answers. There may be a pop-quiz on these homework questions any time between Tues 9/13 and Thur 9/27 inclusive. You may work together on these homework questions. However, I strongly advise you to try to solve them yourself first, then compare answers with others afterwards. Please do not discuss the homework on the class discussion mailing list. 1. What is the biggest performance cost in context switching? What hardware/architecture support would you need to make context switching "free" ? 2. The way that kernel handles context switch is somewhat similiar to interrupt handling. Can you think of some differences between the two? 3. Describe the differences between user-level threads and kernel-level threads, along with their advantages and disadvantages. Describe a situation where kernel threads would perform better than user threads on a single-processor system. 4. Describe the undesirable consequences that could arise from not enforcing either the "at most once" or "exactly once" semantic. Describe possible uses for a mechanism that has neither of these guarantees. 5. The Unix operating system allows a process to query the kernel to obtain the execution state of any of its children. Therefore, if the children process terminate, kernels are not allowed to discard their process descriptor data until parent process has issued a wait( ) like system call. Describe what problem this design could cause, and how Unix handles it.