Sunday 4 November 2012

Real-Time Scheduling

  • Hard real-time systems – required to complete a critical task within a guaranteed amount of time.
  • Soft real-time computing – requires that critical processes receive priority over less fortunate ones.
  • Round Robin (RR)

    • Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue.
    • If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units.
    • Performance

    1.           q large Þ FIFO
    2.           q small Þ q must be large with respect to context switch, otherwise overhead is too high.

    Priority Scheduling

    • A priority number (integer) is associated with each process
    • The CPU is allocated to the process with the highest priority (smallest integer º highest priority).

    1.          Preemptive
    2.          nonpreemptive

    • SJF is a priority scheduling where priority is the predicted next CPU burst time.
    • Problem º Starvation – low priority processes may never execute.
    • Solution º Aging – as time progresses increase the priority of the process

    CPU Schedular

    • Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them.
    • CPU scheduling decisions may take place when a process:


    1. Switches from running to waiting state.
    2. Switches from running to ready state.
    3. Switches from waiting to ready.
    4. Terminates.

    Dispatcher (operating system concepts)

     

    Dispatcher module gives control of the CPU to the process selected by the short-term scheduler; this involves:
    1. switching context
    2. switching to user mode
    3. jumping to the proper location in the user program to restart that program
    • Dispatch latency – time it takes for the dispatcher to stop one process and start another running.

    Featured post

    10 Best Ways to Earn Money from Facebook

    10 Best Ways to Earn Money from Facebook Facebook is a household name all over the world. The social networking platform has more than...