Page 78 - DCAP403_Operating System
P. 78

Unit 5: Scheduling




          Objectives                                                                            Notes

          After studying this unit, you will be able to:

               Describe CPU scheduling
               Explain CPU scheduling basic criteria
               Know scheduling algorithms
               Describe types of scheduling
               Explain multiple processor scheduling

               Define thread scheduling
          Introduction

          CPU scheduling is the basics of multiprogramming. By switching the CPU among several
          processes the operating systems can make the computer more productive. The objective of
          multiprogramming is to have some process running at all times, in order to maximize CPU
          utilization.

          5.1 CPU Scheduling

          The objective of multiprogramming is to have some process running at all times to maximize
          CPU utilization. The objective of time-sharing system is to switch the CPU among processes
          so frequently that users can interact with each program while it is running. For a uni-processor
          system, there will never be more than one running process. If there are more processes, the rest
          will have to wait until the CPU is free and can be rescheduled.
          As processes enter the system, they are put into a job queue. This queue consists of all processes
          in the system. The processes that are residing in main memory and are ready and waiting to
          execute are kept on a list called the ready queue. This queue is generally stored as a linked list.

          A ready-queue header will contain pointers to the first and last PCBs in the list. Each PCB has a
          pointer field that points to the next process in the ready queue.

          There are also other queues in the system. When a process is allocated the CPU, it executes for a
          while and eventually quits, is interrupted, or waits for the occurrence of a particular event, such
          as the completion of an I/O request. In the case of an I/O request, such a request may be to a
          dedicated tape drive, or to a shared device, such as a disk.  Since there are many processes in the
          system, the disk may be busy with the I/O request of some other process. The process therefore
          may have to wait for the disk. The list of processes waiting for a particular I/O device is called a
          device queue. Each device has its own device queue.























                                           LOVELY PROFESSIONAL UNIVERSITY                                    71
   73   74   75   76   77   78   79   80   81   82   83