Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

What are threads in OS?

1140


Is it safe to cancel chkdsk?

1058


At what mode the fault handler executes?

1129


Explain the main purpose of an operating system?

1135


What is bursting?

980


Define paging and deadlock.

1204


What is a 64 bit application?

998


Difference between logical and physical address space?

1084


Explain what is meant by repetition of information and inability to represent information. Explain why each of these properties may indicate a bad relational database design.

3179


How do I check my filesystem?

1089


Throw some light on internal process memory.

1036


Why do we need threads?

1040


Which is the best operating system for pc?

1047


How many os can be installed in a pc?

1041


Explain the Functionality of Operating System?

1006