How does Windows NT supports Multitasking?



How does Windows NT supports Multitasking?..

Answer / 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

More Operating Systems General Concepts Interview Questions

How deadlock can be detected in a system?

0 Answers  


What are the steps involved in following a particular instruction given by the cpu?

0 Answers  


Do you know what is a binary semaphore? What is its use?

0 Answers  


How long should a chkdsk take?

0 Answers  


Can you move programs from c drive to d?

0 Answers  






What is the code of mobile?

0 Answers  


What are the main difference between Micro-controller and micro-processor?

18 Answers   BEL, Core, Digicom, IBM,


Explain IPC?

0 Answers   Aricent,


What factors determine whether a detection-algorithm must be utilized in a deadlock avoidance system?

0 Answers  


Is 64 bit excel faster?

0 Answers  


What is a 64 bit application?

0 Answers  


Do I install 32 bit or 64 bit office?

0 Answers  


Categories