multitasking

Definition of multitasking in The Network Encyclopedia.

What is Multitasking (in computer science)?

What an operating system does when it runs two or more programs simultaneously. From the point of view of the user, the programs appear to be executing at the same time, but from the operating system’s point of view, one of two things might be happening:

  • On a multiprocessor machine, each processor might be running a separate program simultaneously. This is true multitasking, which can only take place on machines with more than one processor and with operating systems that support multiple processors. Microsoft Windows 95 and Windows 98 are designed to run on machines with a single processor, but Windows NT supports systems with up to four processors (or eight in the Enterprise edition).
  • On a single-processor machine, the operating system time-slices between applications so that each application receives a small portion of time to run before giving this privilege to another application.

There are two basic types of multiprocessing on machines that run versions of the Windows operating system:

  • Preemptive multitasking:
    The operating system decides which thread or process is allowed to run at any specific time. Windows 95, Windows 98, and Windows NT support this form of multitasking.

     

  • Cooperative multitasking:
    Each application is responsible for voluntarily relinquishing control to other applications. Windows 3.x supports this form of multitasking.

     

Windows NT supports symmetric multiprocessing (SMP) on multiprocessor machines, whereby the Windows NT kernel lets processors share memory and assign ready threads to the next available processor.

This SMP support ensures that no processor is ever idle or running a low-priority thread when a high-priority thread is waiting. Windows NT also supports soft affinity, whereby a thread tries to run on the same processor it last ran on, all things being equal. You can also use Task Manager to assign a specific process to a processor.