Next: About this document ...
Ceng 328 Operating Systems
Final
Jun 5, 2006 15.00-17.00
Good Luck!
Solve 10 questions.
- What are the differences between a trap and an interrupt? What is the use of each function?
- There are two different levels at which threads can be implemented. What are they and how do they differ? What advantages and disadvantages do each have?
- Solve the followings;
i. A system has two processes and three identical resources. each process needs a maximum of two resources. Is deadlock possible? Explain your answer.
ii. Consider previous problem again, but now with p processes each needing a maximum of m resources and a total of r resources available. What condition must hold to make the system deadlock free?
- For each of the following system calls, give a condition that causes it to fail: fork and exec.
- Consider the following sets of processes, with the length of the CPU-burst time given in milliseconds. Arrival time is the time at which the process is added to the ready queue.
Process |
Burst Time |
Arrival Time |
P1 |
20 |
0 |
P2 |
1 |
0 |
P3 |
6 |
0 |
P4 |
8 |
0 |
P5 |
4 |
8 |
P6 |
2 |
12 |
- a
- Draw appropriate charts illustrating the execution of these processes using FCFS, SJF non-preemptive, and SJF preemptive.
- b
- Calculate the wait times of each process for each strategy. Calculate the average wait times under each strategy.
Process |
FCFS |
SJF-nonpremptive |
SJF |
P1 |
|
|
|
P2 |
|
|
|
P3 |
|
|
|
P4 |
|
|
|
P5 |
|
|
|
P6 |
|
|
|
Average |
|
|
|
- For deadlock to occur, four conditions must hold: mutual exclusion, hold and wait, no preemption, and circular wait. If any one condition does not hold, no deadlock can occur. Assume we want to allow preemption , and thus get out of deadlocks; in other words, if a deadlock is detected, we will forcibly take a lock away from a thread; by repeatedly doing this, we will eventually undo the deadlock. What new problems are introduced by this preemptive approach?
- How does segmentation differ from paging?
- What causes a page fault? What actions may be taken by the OS when servicing a page fault?
- A computer uses the relocation scheme of base-limit pair. A program is 10000 bytes long and is loaded at address 40000. What values do the base and limit register get according to the scheme?
- Estimated total average acces time in disks is given as the following formula
i.Describe each term in the formula
ii. The following values are given; fill the tables
ms,
rpm, At 5000 rpm, one revolution per 9ms average delay 4.5ms
768B sect, 480 sect/track,
Read a file with 3840 sectors (=2.88MB)
1.) File stored compactly (adjacent tracks): Read first track
2.) Sectors distributed randomly over the disk: Read any sector
1.)
Average seek |
|
Rot. Delay |
|
Read 480 sectors |
|
Total |
|
All sectors |
|
2.)
Average seek |
|
Rot. Delay |
|
Read 1 sectors |
|
Total |
|
All |
|
- Explain the UNIX index node (inode) structure in detail.
- You are to compare reading a file using a single-threaded file server and a multithreaded server. It takes 15 msec to get a request for work, dispatch it, and do the rest of the necessary processing, assuming that the data needed are in the block cache. If a disk operation is needed, as is the case one-third of the time, an additional 75 msec is required, during which time the thread sleeps. How many requests/sec can the server handle if it is single threaded? If it is multithreaded? (Hint: 1000 msec=1 sec )
Next: About this document ...
Cem Ozdogan
2007-03-28