Operating System Fundamentals


Scenario Two The Coffee Pot gets Higher Priority



Download 2.34 Mb.
View original pdf
Page36/66
Date06.03.2023
Size2.34 Mb.
#60834
1   ...   32   33   34   35   36   37   38   39   ...   66
OperatingSystemFundamentals
best answers from c, Lesson 2 C# Windows Forms
Scenario Two The Coffee Pot gets Higher Priority
This sounds like a silly idea but consider the sequence of events.
1. Times. Both alarms sound. Coffeepot starts to be switched off.
2. Times. Coffeepot is switched off. Reactor rod robot started.
3. Times. Reactor rods inserted and meltdown prevented. In this solution, the control rods were inserted well within the required time and we also avoided the flooded break room.
Conclusion
Processes with important responsibilities do not always need the highest priority. The selection of priorities is based a combination of how quickly a process must react and how long it will take to complete.

Operating System Fundamentals
51
Other Scheduling Algorithms
There area number of other scheduling algorithms that are described in various texts, but they are often based on older operating systems where programs ran without a user sitting in front of the computer. We include a brief description of each of these for completeness.
First Come First Serve
In this algorithm, there is no preemptive switching. When a process is scheduled it runs until it is completely finished (or perhaps until it blocks. The idea is quite simple once a process is started the most efficient thing to do is to let it run until is completely finished before allowing another process to run. This scheduling algorithm does notwork for situations where two processes are working together to solve some problem however from a purely efficiency point of view it works well and there is no fear of having one process being interrupted by any other process. Ina system running this type of scheduling the process table is created with a list of all the processes and then run without modification until all tasks are done (or new tasks added only between processes.
Shortest Task Remaining
The idea for this algorithm is to figure out which process will finish in the shorted amount of time and schedule the processes in an order that finishes as quickly as possible. It tends to favor short processes over longer processes. The danger is that a lot of short processes could easily starve a longer process. It is also not practical because you cannot actually know for certain how much more time is remaining fora given process.

Download 2.34 Mb.

Share with your friends:
1   ...   32   33   34   35   36   37   38   39   ...   66




The database is protected by copyright ©ininet.org 2024
send message

    Main page