next up previous
Next: Process Synchronization Up: Comparison Between Windows3.1 Previous: Comparison Between Windows3.1

Process Scheduling

Both Windows3.1 and Windows95 are multitasking system. Windows3.1 is said to be cooperative multitasking system. The scheduler can do a context switching only when the currently running process surrenders the CPU. The programmers of application programs are required to put yielding points in the program so that the application program hand the CPU back to the operating system regularly. In other words a process can hold the CPU for unreasonably long time. However there were good points for programmers of both operating systems and application programs. For instance the operating system code does not have to be reentrant, or an application program will not be preempted while it is running its critical section.

Windows95 is a both cooperative and preemptive multitasking system. Thread model is used in Windows95 and it is classified as kernel mode thread as its execution is controlled by system schedulers. There are two schedulers in Windows95; the primary scheduler which is responsible to calculate thread priorities, and the timeslice scheduler which calculates the timeslice allocation to each thread. These two schedulers work as follows:

  1. The primary scheduler examines the priority (between 0 and 31) of each thread with the following techniques:

    Dynamic priority boosting
    Temporary boosting of lower priority threads when needed (e. g. threads receiving key input).

    Time decay
    Boosted priority will be gradually returned to its base priority.

    Priority inheritance
    If a thread with a low priority is allocated exclusive resources that another thread with higher priority is waiting for, its priority will be boosted to solve the contention.

  2. The primary scheduler preempts the current running thread if there appear threads with higher priority.

  3. The timeslice scheduler calculates the time-slice for each thread based on its priority.

  4. Priority re-calculation is done by the primary scheduler every 20msec.

  5. If more than one threads have the same highest priority, they are treated as round-robin scheduling.



next up previous
Next: Process Synchronization Up: Comparison Between Windows3.1 Previous: Comparison Between Windows3.1



Hitoshi Oi
Wed Dec 20 23:53:45 EST 1995