16 scheduling queues and schedulers contd the short

This preview shows page 8 - 13 out of 41 pages.

16 Scheduling Queues and Schedulers (cont’d) ! The short-term scheduler must be fast. " If it takes 10 ms to decide to execute a process for 100 ms, then 10 / (10 + 100) = 9% of the CPU is being wasted for scheduling the work. ! However, because of the longer interval between executions, the long-term scheduler can afford to take more time to decision. ! The long-term scheduler controls the degree of multiprogramming. ! In general, processes can be described as either I/O bound or CPU bound . " A I/O-bound process spends more of its time doing I/O. " A CPU-bound process uses more of its time doing computations. " A good long-term scheduler should select a good process mix of I/O-bound and CPU-bound processes that the system will be balanced.
Image of page 8

Subscribe to view the full document.

Processes 9 17 Scheduling Queues and Schedulers (cont’d) ! For systems with no long-term schedulers: " The stability of the systems may depend on the self- adjusting nature of human users. # If the performance declines to unacceptable levels on a multi-users system, some users will simply quit. ! Some operating systems may introduce a medium-term scheduler . " It removes processes from memory and thus reduce the degree of multi-programming ( swap out ) . " Later, the processes can be reintroduced into memory for execution ( swap in ) . " Swapping may improve the process mix. # Or for better memory management. 18 Scheduling Queues and Schedulers (cont’d) Addition of medium-term scheduling to the queueing diagram.
Image of page 9
Processes 10 19 Context Switch ! When CPU switches to another process, the system must save the context of the old process and load the saved context for the new process. " E.g., interrupts cause the operating system to change a CPU from its current task to run a kernel routine. ! Such a switching is known as a context switch . ! The context is represented in the PCB of the process. " The value of the CPU registers. " The process state. " Program counter. " 20 Context Switch (cont’d) ! Context-switch time is overhead; the system does no useful work while switching. ! Dependent on hardware support. " Some processors provide multiple sets of registers. # A context switch simply requires changing the pointer to the current register set.
Image of page 10

Subscribe to view the full document.

Processes 11 21 Operations on Processes 22 Process Creation ! A process may create several new processes, via a create- process system call. ! The creating process is called a parent process, and the new processes are called the children of that process. " New processes may in turn create other processes, forming a tree of processes. ! Most operating system (UNIX and MS Windows) identify processes according to a unique process identifier (pid) . " Usually an integer number.
Image of page 11
Processes 12 23 Process Creation (cont’d) A tree of processes on a typical Solaris 24 Process Creation (cont’d) ! On UNIX, the ps command can be used to obtain the information of all process.
Image of page 12

Subscribe to view the full document.

Image of page 13
You've reached the end of this preview.
  • Spring '12
  • GwangS.Jung

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern