Tutorial Week 4

Questions

Processes and Threads

Q1: In the three-state process model, what do each of the three states signify? What transitions are possible between each of the states, and what causes a process (or thread) to undertake such a transition?

Q2: Compare cooperative versus preemptive multithreading?

Q3: Describe user-level threads and kernel-level threads. What are the advantages or disadvantages of each approach?

Q4: Describe a plausible sequence of activities that occur when a timer interrupt results in a context switch.

Q5: When an interrupt or system call transfers control to the operating system, a kernel stack area separate from the stack of the interrupted process is generally used. Why?

Q6: A web server is constructed such that it is multithreaded. If the only way to read from a file is a normal blocking read system call, do you think user-level threads or kernel-level threads are being used for the web server? Why?

Q7: Compare reading a file using a single-threaded file server and a multithreaded file server. Within the file server, it takes 15 msec to get a request for work and do all the necessary processing, assuming the required block is in the main memory disk block cache. A disk operation is required for one third of the requests, which takes an additional 75 msec during which the thread sleeps. How many requests/sec can a server handled if it is single threaded? If it is multithreaded?