You are on page 1of 10

When NT creates a new process, it uses the

The Windows NT process

object class, or type defined for the NT process At the time of creation, attributes values are one thread to execute. The thread may then

as a template to generate a new object instance. assigned. An NT process must contain at least create other threads. In multiprocessor system, multiple threads from the same process may execute in parallel. Generally, a process, an abstraction of a running program is the most

central concept in any OS. Windows NT support threads within processes. Threads incorporate some of the functionality traditionally associated with processes. The distinction refined from the :previous list is Threads: A dispatchable unit of work. It is the thing that executes sequentially and is interruptible so that the processor can turn to
1

another thread. From the point of view of scheduling and dispatching, this concept is .OSes equivalent to that of a process on most other Process: A collection of one or more threads and associated system resources such as memory, open files and devices. This corresponds closely to the concept of a program in execution. By breaking a single application up into multiple threads, the programmer has great control over

the modularity of the application and the timing of application-related events. From the point of view of the job or application, this concept is equivalent to that of a process on most other OSes

The following Figure shows the Windows NT process and its resources .relationship

Important characteristics of NT .processes are the listed below An executable process may contain one or moreBoth process and thread objects have built-in - .synchronization capabilities .threads - .NT processes are implemented as objects

The NT kernel does not maintain anyrelationship among the processes that it creates, .including parent-child relationship

And the following Figure shows Windows NT OS architecture in a layered .structure

The previous Figure illustrates the overall structure of Windows NT. Its highly modular structure gives Windows NT the flexibility. NT can execute on variety of hardware platforms and supports applications written for a variety of other OSes too. As virtually all OSes, NT

separates application-oriented software from OS software. The latter runs in what is generally referred to as privileged mode or kernel mode. Kernel-mode software has access to system data and to the hardware. The remaining software, running in user mode, has limited access to system data. The kernel-mode software is referred to as the NT executive. Whether it is

running on a uniprocessor or multiprocessor, a CISC (Intel) or RISC (Motorola) system, most of NT sees the same view of the underlying .hardware

In Windows NT, you can use the POSIX fork/exec calls to create a new process. Alternatively, you can use the CREATEPROCESS call which loads a new .also available in Windows 95

program and starts execution. This function is Process creation tends to be fast in UNIX and POSIX and slower in Windows NT and MPE. Program designs for UNIX often use new processes for many tasks which would be

function calls on MPE. As well, the UNIX fork function allows the new process to inherit all the open files and resources of the parent, which the .MPE CREATEPROCESS does not In UNIX and POSIX you call fork() and then exec() to create a process. When you fork it clones a copy of your current process, including all data, code, environment variables, and open

files. This child process is a duplicate of the parent (except for a few details). fork() returns the process ID of the child to the parent process and a zero to the child process (remember, both are now executing). The child may then call exec() to replace itself with the code of a

different program (if that was your goal). The new child process will have the same files open as the parent, except those whose close-on-exec .flag was set with fcntl :In pseudo-code, this is ()result := fork fork() failed# this is the Parent# result=0, this is the Child#
7

if result < 0

elseif result > 0 elseif

call exec() to "replace myself" with another# ()exec ()control will Never return here from exec# instead if goes to the new program code# endif UNIX, POSIX, and Windows NT have a form of "light process" known as a Thread. A thread is an independent unit of execution within a process. MPE is acquiring threads too, as part of the DCE project. A sequential process has a executed by the process. In a multithreaded single flow of control, a sequence of instructions process, there are multiple scheduled flows of smaller pieces, a thread can run each piece concurrently, if you have a Symmetric Multiprocessor machine. Without threads the prog

control called threads. By splitting a problem into

programming strategy is to use multiple processes, communicate using some form of IPC don't have the overhead of IPCs because all the threads of a process share the same data space .and system resources Every process in a Windows NT operating (Inter-Process Communication). With threads you

environment is represented by a process object structure and has an execution context that is unique to that process. The execution context for the process includes the process virtual address space (described in greater detail in the next chapter), a set of resources visible to that

process, and a set of threads that belong to the process. Examples of resources owned by a process include file handles for files opened by that process, any synchronization objects created by that process, and any other objects that are
9

created either by the process or on behalf of that .process

10

You might also like