online discussion-4 Version 0 |
|
👤 Author: by writer 2020-10-13 01:02:06 |
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
Please login to reply. Login
CPU SCHEDULING a process of determining which process will own CPU for execution while another process is on hold. The main task of CPU scheduling is to make sure that whenever the CPU remains idle, the OS at least select one of the processes available in the ready queue for execution. The selection process will be carried out by the CPU scheduler. It selects one of the processes in memory that are ready for execution.
<h4 id="5308" class="cp cq cr cs b ct cu cv cw cx cy cz da db dc dd de df dg dh di dj"><strong>CPU Scheduling Algorithms</strong></h4>
<p id="412e" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">The CPU, like every part of the computer has a task to perform, as well as a set of instructions on how to perform such tasks. Since a numerous amount of programs can be in memory at the same time, the CPU needs a sequence of functionality; that’s where the process manager comes in. The Process manager handles the removal of the running process from the CPU and the selection of another process.</p>
<p id="5746" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">The OS maintains all Process in scheduling Queues. It maintains a separate queue for each of the process states and when the state of a process is changed, it is unlinked from its current queue and moved to its new state queue.</p>
<p class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><img src="https://miro.medium.com/max/491/1*B8DCskub0VXdf3liNq6Uxg.jpeg" alt="Image for post" /></p>
<ul class="">
<li id="4181" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gz ha hb dj" data-selectable-paragraph=""><strong class="fj hc">Job queue</strong> − This queue keeps all the processes in the system.</li>
<li id="ae4c" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph=""><strong class="fj hc">Ready queue</strong> − This queue keeps a set of all processes that are in memory, and are waiting to be executed</li>
<li id="fab5" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph=""><strong class="fj hc">Device queues</strong> − The processes which are blocked due to unavailability of an I/O device constitute this queue.</li>
</ul>
<p id="31af" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">The OS can use different scheduling algorithms to manage each queue. The process manager determines how to move processes between the ready and run queues which can only have one entry per processor core on the system.</p>
<p id="c9a0" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">There are six popular methods of scheduling processes to the CPU, which are:</p>
<ul class="">
<li id="2ac5" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge gz ha hb dj" data-selectable-paragraph="">First Come, First Serve</li>
<li id="fd75" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph="">Shortest Job First</li>
<li id="0083" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph="">Priority Scheduling</li>
<li id="f9c6" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph="">Shortest Remaining Time</li>
<li id="0046" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph="">Round Robin(RR)</li>
<li id="5862" class="fh fi cr fj b fk hd fm fn fo he fq fr fs hf fu fv fw hg fy fz ga hh gc gd ge gz ha hb dj" data-selectable-paragraph="">Multiple-Level Queues</li>
</ul>
<p id="31b4" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">These algorithms can be either non-preemptive or preemptive. Non-preemptive algorithms are made so that once a process has a the resource, it does not have to let go of the resource until its given time if over. In the other hand, the preemptive scheduling functions with priority, which means the schedule can stop the process from using the resource to give it to another process with a higher priority.</p>
<p id="ae74" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">First In, First Out:</strong></p>
<figure class="gg gh gi gj gk gl cb cc paragraph-image">
<div class="cb cc hi">
<div class="gr s gs gt">
<div class="hj gv s">
<div class="gm gn t u v go aj dv gp gq"><img class="t u v go aj gw gx at ss" src="https://miro.medium.com/max/60/1*tAf9CrfiH0IYUCKBMgNASw.jpeg?q=20" alt="Image for post" width="484" height="293" /></div>
<img class="sn so t u v go aj c" src="https://miro.medium.com/max/484/1*tAf9CrfiH0IYUCKBMgNASw.jpeg" sizes="484px" srcset="https://miro.medium.com/max/276/1*tAf9CrfiH0IYUCKBMgNASw.jpeg 276w, https://miro.medium.com/max/484/1*tAf9CrfiH0IYUCKBMgNASw.jpeg 484w" alt="Image for post" width="484" height="293" /></div>
</div>
</div></figure>
<p id="1997" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">First come first serve, is just as it sounds like. The task that comes first, gets executed first. It is also a non-preemptive algorithm. While this method ensures that each process has a fair amount of time to be executed, it usually has poor performance due to high average waiting time.</p>
<p id="b415" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">Shortest Job First:</strong></p>
<figure class="gg gh gi gj gk gl cb cc paragraph-image">
<div class="cb cc hk">
<div class="gr s gs gt">
<div class="hl gv s">
<div class="gm gn t u v go aj dv gp gq"><img class="t u v go aj gw gx at ss" src="https://miro.medium.com/max/60/1*L_V1OgsQEPFMwSxcMy1Kxg.jpeg?q=20" alt="Image for post" width="485" height="299" /></div>
<img class="sn so t u v go aj c" src="https://miro.medium.com/max/485/1*L_V1OgsQEPFMwSxcMy1Kxg.jpeg" sizes="485px" srcset="https://miro.medium.com/max/276/1*L_V1OgsQEPFMwSxcMy1Kxg.jpeg 276w, https://miro.medium.com/max/485/1*L_V1OgsQEPFMwSxcMy1Kxg.jpeg 485w" alt="Image for post" width="485" height="299" /></div>
</div>
</div></figure>
<p id="f556" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">Shortest Job First is a preemptive algorithm that executes the shortest job first. This algorithm has one of the best approach to minimize the waiting time, when the processor knows in advance how much time it will take to execute each process. In an interactive OS this algorithms fails, since small process will get to cut the line each time they arrive which could lead to starvation of the longer tasks.</p>
<p id="5b06" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">Priority Scheduling</strong></p>
<figure class="gg gh gi gj gk gl cb cc paragraph-image">
<div class="cb cc hi">
<div class="gr s gs gt">
<div class="hj gv s">
<div class="gm gn t u v go aj dv gp gq"><img class="t u v go aj gw gx at ss" src="https://miro.medium.com/max/60/1*NiH---sfzSelEKZOjGf40g.jpeg?q=20" alt="Image for post" width="484" height="293" /></div>
<img class="sn so t u v go aj c" src="https://miro.medium.com/max/484/1*NiH---sfzSelEKZOjGf40g.jpeg" sizes="484px" srcset="https://miro.medium.com/max/276/1*NiH---sfzSelEKZOjGf40g.jpeg 276w, https://miro.medium.com/max/484/1*NiH---sfzSelEKZOjGf40g.jpeg 484w" alt="Image for post" width="484" height="293" /></div>
</div>
</div></figure>
<p id="a5e4" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">Priority Scheduling is a non-preemptive algorithm that assigns each task a priority number to be executed by. If two task arrive at the same time, they would be dealt in a first come first serve manner. Priority can be decided on a number of factors such as memory requirements, time requirements or any other resource requirement.</p>
<p id="28f0" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">Shortest Remaining Time:</strong></p>
<p id="52d0" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">Shortest Remaining Time is very similar to Short Job First. Unlike SJF, this algorithm looks at how much time is left in the execution time of the task in order to give it CPU time. This algorithm is also preemptive.</p>
<p id="d87e" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">Round Robin</strong></p>
<figure class="gg gh gi gj gk gl cb cc paragraph-image">
<div class="cb cc hm">
<div class="gr s gs gt">
<div class="hn gv s">
<div class="gm gn t u v go aj dv gp gq"><img class="t u v go aj gw gx at ss" src="https://miro.medium.com/max/60/1*5mxGaDvwu_61bhrKIhvglw.jpeg?q=20" alt="Image for post" width="638" height="479" /></div>
<img class="sn so t u v go aj c" src="https://miro.medium.com/max/638/1*5mxGaDvwu_61bhrKIhvglw.jpeg" sizes="638px" srcset="https://miro.medium.com/max/276/1*5mxGaDvwu_61bhrKIhvglw.jpeg 276w, https://miro.medium.com/max/552/1*5mxGaDvwu_61bhrKIhvglw.jpeg 552w, https://miro.medium.com/max/638/1*5mxGaDvwu_61bhrKIhvglw.jpeg 638w" alt="Image for post" width="638" height="479" /></div>
</div>
</div></figure>
<p id="4820" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">Round Robin is a preemptive algorithm, which works by using a quantum time. Each task is only allowed to run for this quantum time, The task manager then preempts the resource and gives it to the next task. It repeats this process until all task are finish.</p>
<p id="2ae7" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph=""><strong class="fj hc">Multiple-Level Queues</strong></p>
<p id="9efc" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">Multiple-level queues are used when tasks can places into groups depending on their characteristics, such as CPU time or Memory size. Each queue is assign a priority to be executed, and are allowed to have its own scheduling algorithm.</p>
<p id="19a6" class="fh fi cr fj b fk fl fm fn fo fp fq fr fs ft fu fv fw fx fy fz ga gb gc gd ge cj dj" data-selectable-paragraph="">For example, CPU-bound jobs can be scheduled in one queue and all I/O-bound jobs in another queue. The Process Scheduler then alternately selects jobs from each queue and assigns them to the CPU based on the algorithm assigned to the queue.</p> PostVer 0
Please login to reply. Login