How does Windows NT supports Multitasking?

Answer Posted / asd

Preemptive multitasking differs from non-preemptive
multitasking in that the operating system can take control
of the processor without the task's cooperation. (A task can
also give it up voluntarily, as in non-preemptive
multitasking.) The process of a task having control taken
from it is called preemption. Windows NT uses preemptive
multitasking for all processes except 16-bit Windows 3.1
programs. As a result, a Window NT application cannot take
over the processor in the same way that a Windows 3.1
application can.

A preemptive operating system takes control of the processor
from a task in two ways:

When a task's time quantum (or time slice) runs out. Any
given task is only given control for a set amount of time
before the operating system interrupts it and schedules
another task to run.

When a task that has higher priority becomes ready to run.
The currently running task loses control of the processor
when a task with higher priority is ready to run regardless
of whether it has time left in its quantum or not.

Switching Among Tasks

At any given time, a processor (CPU) is executing in a
specific context. This context is made up of the contents of
its registers and the memory (including stack, data, and
code) that it is addressing. When the processor needs to
switch to a different task, it must save its current context
(so it can later restore the context and continue execution
where it left off) and switch to the context of the new
task. This process is called context switching .

When Windows NT switches tasks, it saves all of the
registers of the task it's leaving and re-loads the
registers of the task to which it's switching. This process
also enables the proper address space for the task to which
Windows NT is switching.

Processes and Threads

In addition to being a preemptive multitasking operating
system, Windows NT is also multithreaded, meaning that more
than one thread of execution (or thread ) can execute in a
single task at once.

A process comprises:

A private memory address space in which the process's code
and data are stored.

An access token against which Windows NT makes security checks.

System resources such as files and windows (represented as
object handles).

At least one thread to execute the code.

A thread comprises:

A processor state including the current instruction pointer.

A stack for use when running in user mode.

A stack for use when running in kernel mode.

Since processes (not threads) own the access token, system
resource handles, and address space, threads do NOT have
their own address spaces nor do they have their own access
token or system resource handles. Therefore, all of the
threads in a process SHARE the same memory, access token,
and system resources (including quota limits) on a
"per-process" rather than a "per-thread" basis. In a
multithreaded program, the programmer is responsible for
making sure that the different threads don't interfere with
each other by using these shared resources in a way that
conflicts with another thread's use of the same resource.
(As you might suspect, this can get a little tricky.)

Sources:
http://technet.microsoft.com/en-us/library/cc767883.aspx

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I tell what devices are connected to my usb?

537


What are advantages of operating system?

549


How do I use i3?

597


What is crpc in law?

573


What is raid? What are the different raid levels?

553






Define the basic logical structure of a computer.

548


Can you fix blue screen of death?

534


What are the steps of booting?

606


Why is it that a single, all – encompassing metric cannot be developed for programme complexity or programme quality?

1660


How do I delete an operating system?

586


What do you mean by response time and turnaround time?

600


What is synchronously and asynchronously?

532


While running DOS on a PC, which command would be used to duplicate the entire diskette?

4157


What is the use of paging in operating system?

539


Explain what are device drivers used for?

613