Ppt process management windows




















The process cannot directly modify these structures but must rely on the virtual memory manager, which provides a memory-allocation service for the process. Finally the process includes an object table, which handles to other objects known to this process. One handle exists for each thread contained in this object. In this figure, there is a single thread shown.

Additionally the process has access to a file object and to a section object that defines a section of shared memory. Each NT process is represented by an object.

Each process is defined by a number of attributes and encapsulates a number of actions, or services, that it may perform. A process will perform a service upon receipt of the appropriate message. The only way to invoke such a service is by means of messages to a process object that provides that service. When NT creates a new process, it uses the object class, or type defined for the NT process as a template to generate a new object instance.

At the time of creation, attributes values are assigned. An NT process must contain at least one thread to execute. The thread may then 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.

From the OS general view a concept of process having the following two characteristics:. Unit of dispatching : A process is an execution path trace through one or more programs. This execution may be interleaved with other processes. Thus a process has an execution state running, ready etc. These two characteristics are independent and could be treated independently by OS. To distinguish the two characteristics, the unit of dispatching is usually referred to as a thread or lightweight process, whereas the unit of resource ownership is usually still referred to as a process or task.

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 another thread.

From the point of view of scheduling and dispatching, this concept is equivalent to that of a process on most other OSes. 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. A thread is code that is to be serially executed within a process.

A processor executes threads, not processes, so each bit application has at least one process, and a process always has at least one thread of execution, known as the primary thread.

A process can have multiple threads in addition to the primary thread. Prior to the introduction of multiple threads of execution, applications were all designed to run on a single thread of execution. Processes communicate with one another through messages , using Microsoft's Remote Procedure Call RPC technology to pass information to one another.

There is no difference to the caller between a call coming from a process on a remote machine and a call coming from another process on the same machine.

When a thread begins to execute, it continues until it is killed or until it is interrupted by a thread with higher priority by a user action or the kernel's thread scheduler.

Each thread can run separate sections of code, or multiple threads can execute the same section of code. Threads executing the same block of code maintain separate stacks. Each thread in a process shares that process's global variables and resources.

The thread scheduler determines when and how often to execute a thread, according to a combination of the process's priority class attribute and the thread's base priority. Multithreaded applications must avoid two threading problems: deadlocks and races. A deadlock occurs when each thread is waiting for the other to do something. A race condition occurs when one thread finishes before another on which it depends, causing the former to use a bogus value because the latter has not yet supplied a valid one.

The life of a process is bounded by its creation and termination. When a new process is to be added to those that are currently being managed by the operating system, the operating system builds the data structures that are used to manage the process and allocates the address space to be used by the process. These actions constitute the creation of a new process. Some of the common events that lead to the creation of a process are listed in the following table.

The OS is provided with a batch-job-control system, usually on tape or disk. When the OS is prepared to take on new work, it will read the next sequence of job-control commands. A process is created in response to the submission of a job. The OS is responsible to create a new process. A user at the terminal logs on to the system. Created by OS to provide a service. The OS can create a process to perform a function on behalf of a user program, without the user having to wait such as printing.

Spawned by existing process. For purposes of modularity or to exploit parallelism, a user program can dictate the creation of a number od processes.

For example a server process such as print, file and web server may create a new process for each request of another process. Normally referred to as process spawning. When one process spawns another process, the spawning process is referred to as the parent process and the spawned process is referred is referred to as the child process and normally these processes will need to communicate and cooperate with each other.

Table 1. And the typical reasons for process termination are listed in the following Table. The process executes an OS service call to indicate that it has completed running. The process requires more memory than the system can provide. The process attempts to use an instruction reserved for the operating system. The process tries to access memory location that it is not allowed to access. Suspended Processes A kernel needs additional states to describe the nature of the activity of a process that is not in one of the four fundamental states described earlier.

Consider a process that was in the ready or the blocked state when it got swapped out of memory. Accordingly, the kernels view of a process consists of two parts: Code, data, and stack of the process, and information concerning memory and other resources, such as files, allocated to it.

Information concerning execution of a program, such as the process state, the CPU state including the stack pointer, and some other items of information described later. These two parts of the kernels view are contained in the process context and the process control block PCB , respectively. Process Context consists of the following: Address space of the process: The code, data, and stack components of the process.

Memory allocation information: Information concerning memory areas allocated to a process. This information is used by the memory management unit MMU during operation of the process. Status of file processing activities: Information about files being used, such as current positions in the files. Process interaction information: Information necessary to control interaction of the process with other processes, e. Resource information: Information concerning resources allocated to the process.

Miscellaneous information: Miscellaneous information needed for operation of a process. The process control block PCB of a process contains three kinds of information concerning the process: Identification information such as the process id, id of its parent process, and id of the user who created it.

Information that is useful in controlling its operation, such as its priority, and its interaction with other processes. It also contains a pointer field that is used by the kernel to form PCB lists for scheduling, e. The priority and state information is used by the scheduler.

It passes the id of the selected process to the dispatcher. Context Save, Scheduling, and Dispatching The context save function performs housekeeping whenever an event occurs. The scheduling function uses the process state information from PCBs to select a ready process for execution and passes its id to the dispatching function. Open navigation menu. Close suggestions Search Search. User Settings. Skip carousel. Carousel Previous.

Carousel Next. What is Scribd? Explore Ebooks. Bestsellers Editors' Picks All Ebooks. Explore Audiobooks. Bestsellers Editors' Picks All audiobooks. Explore Magazines. Editors' Picks All magazines. Explore Podcasts All podcasts. See our User Agreement and Privacy Policy. See our Privacy Policy and User Agreement for details.

Create your free account to read unlimited documents. The SlideShare family just got bigger. Home Explore Login Signup. Successfully reported this slideshow. We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads.

You can change your ad preferences anytime. Next SlideShares. You are reading a preview. Create your free account to continue reading. Sign Up. Upcoming SlideShare. Related Books Free with a 30 day trial from Scribd. Dry: A Memoir Augusten Burroughs. Related Audiobooks Free with a 30 day trial from Scribd. Process management in os 1. Process Management 2. The OS must allocate resources to processes, enable processes to share and exchange information, protect the resources of each process from other processes and enable synchronization among processes.

Various events can cause a process to change states. This function is heavily dependent on queues. Single Queuing - All process arrives at the same time with their corresponding burst time. Multiple Queuing — Each process has its own arrival time in the processor. Histogram of CPU-burst Times Switches from running to waiting state by sleep. Switches from running to ready state by yield.

Switches from waiting to ready by an interrupt. Algorithms Tries to predict the process to schedule based on previous history.



0コメント

  • 1000 / 1000