hongjun
09-07-2003, 07:30 AM
I have got 1 question to ask. It's an exercise found in a textbook.
Question
Sometimes OS features consipre to cause trouble. For example, consider an OS with (i) a scheduler which alway chooses the highest priority process/task to run next, and (ii) an OS call wait() which a process/task uses to handle Mutual Exclusion Critical Section (MECS) problems. The wait() loops until the shared resource is free.
(a) How does this system go wrong?
(b) There were four conditions needed to ensure that we avoid CS problems. Which of these conditions is(are) broken by this system?
For your reference, below are the 4 conditions needed to ensure that we avoid CS problems.
1. No two processes may be simultaneously inside their critical regions.
2. No assumptions may be made about speeds or the number of CPUs.
3. No process running outside its critical region may block other processes.
4. No process should have to wait forever to enter its critical region.
My answer to the practice question is as follows.
Ans to (a)
Indefinite postponement. I believe so because if there are many processes waiting for the shared resource, the lowest piority process/task may not be able to get it if there are always new incoming processes and they happen to want that resource.
Ans to (b)
The fourth condition is broken.
Please comment!
Thanks
hongjun
Question
Sometimes OS features consipre to cause trouble. For example, consider an OS with (i) a scheduler which alway chooses the highest priority process/task to run next, and (ii) an OS call wait() which a process/task uses to handle Mutual Exclusion Critical Section (MECS) problems. The wait() loops until the shared resource is free.
(a) How does this system go wrong?
(b) There were four conditions needed to ensure that we avoid CS problems. Which of these conditions is(are) broken by this system?
For your reference, below are the 4 conditions needed to ensure that we avoid CS problems.
1. No two processes may be simultaneously inside their critical regions.
2. No assumptions may be made about speeds or the number of CPUs.
3. No process running outside its critical region may block other processes.
4. No process should have to wait forever to enter its critical region.
My answer to the practice question is as follows.
Ans to (a)
Indefinite postponement. I believe so because if there are many processes waiting for the shared resource, the lowest piority process/task may not be able to get it if there are always new incoming processes and they happen to want that resource.
Ans to (b)
The fourth condition is broken.
Please comment!
Thanks
hongjun