Tutorial Week 6
- Compare cooperative versus preemptive multithreading?
- Describe user-level threads and kernel-level threads. What are the advantages or disadvantages of each approach?
Describe a plausible sequence of activities that occur when a timer interrupt results in a context switch.
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?
Assume a multi-process operating system with single-threaded applications. The OS manages the concurrent application requests by having a thread of control within the kernel for each process. Such a OS would have an in-kernel stack assocaited with each process.
Switching between each process (in-kernel thread) is performed by the function switch_thread(cur_tcb,dst_dst). What does this function do?
Describe the memory hierarchy. What types of memory appear in it? What are the characteristics of the memory as one moves through the hierarchy? How can do memory hierarchies provide both fast access times and large capacity?
Given that disks can stream data quite fast (1 block in tens of microseconds), why are average access times for a block in milliseconds?
You have a choice of buying a 3 Ghz processor with 512K cache, and a 2 GHz processor (of the same type) with a 3 MB cache for the same price. Assuming memory is the same speed in both machines and is much less than 2GHz (say 400MHz). Which would you purchase and why? Hint: You should consider what applications you expect to run on the machine.
What permissions would you have on the following files:
om:[/tmp]% ls -ld t* . drwxrwxrwt 6 root root 4096 May 21 12:19 . -rw-rw---- 1 nash stud 216 May 18 18:59 t1 -rw--w---- 1 nash stud 260 May 18 18:59 t2 -rw------- 1 nash stud 458 May 18 18:59 t3 -rwsrwsr-x 1 nash stud 138 May 21 12:19 t4 -rwsrwxr-x 1 nash stud 285 May 21 12:19 t5