This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSE451 Exam #1 (version A) Fall 2006 Your Name: Short Answer (worth 4 points each) 1) What is the difference between a process and a thread? 2) Suppose we have three jobs: A, B, and C. These jobs have runtimes of 5, 15, and 10 sec- onds, respectively (that is, A=5, B=15, C=10). If the scheduler is rst-come, rst-serve, what is the worst-case arrival ordering for these processes? 3) What is the average turnaround time for the schedule you listed above? Assume the jobs arrive at approximately the same time, and that there is zero context switch cost. 4) The String class in Java is immutable. Also, String contains a substring method, which creates and returns a new String object. How many threads can concurrently execute inside this substring method while preserving thread safety? 5) What prevents ordinary users from directly reading and writing to the disk (instead of passing through the le system)? 6) What is an advantage of layered OS structures, such as Dijkstra s THE system? 1 7) In class, we discussed the concept of user threads, which are implemented entirely in user- mode code. One problem with user threads is that a single blocking operation causes the entire process (and hence, all the user threads) to block. Through a clever implementation, it is possible to implement user threads that can block without blocking the underlying kernel thread. Let s call this version of user threads NB-Threads. In all other respects, NB-Threads behave like the ordinary user threads that we learned about. ( Implementation details: the NB-Threads package uses non-blocking I/O operations. The threads package transparently transforms all blocking read and write operations into non- blocking calls of equivalent functionality. During the non-blocking I/O operation, the threads package blocks the user thread (but not the kernel thread!). Once the I/O operation has com- pleted, the user threads package wakes up the appropriate user thread.pleted, the user threads package wakes up the appropriate user thread....
View Full Document
- Winter '11