Beruflich Dokumente
Kultur Dokumente
PROCESS MANAGEMENT
A Process is an execution of a Program.
Running Instance of a Program is called a process.
Creating Processes
Fulfilling their resource requirements
Scheduling them for use of a CPU
Implement Process Synchronization to control their interaction
Avoid Deadlock so that they do not wait for each other indefinitely
Terminating them when they complete their operation
What is a Process?
Relationships between Processes & Programs
Child Processes
Concurrency and Parallelism
Implementing Processes
Threads
POSIX Threads
Kernel-Level, User-Level and Hybrid Threads
PROGRAM
PROCESSES AND
What is a Process?
A program is a passive entity that
does not perform any actions by
itself; it has to be executed if the
actions it calls for are to take place.
A process is an execution of a program. It
actually performs the actions specified in a
program.
Programs
Processes and
Programs
Processes and
Child Processes
The kernel initiates an execution of a program by creating a process for it. For lack
of a technical term for this process, we will call it the primary process for the
program execution.
The primary process may make system calls ,fork( ) or vfork( ), to create other
processes.
These processes become its child processes, and the primary process becomes their
parent.
A child process may itself create other processes, and so on.
????
Programs
Child Processes
Processes and
Continue
Typically, a process creates one or more child processes and delegates some of
its work to each of them. It is called multitasking within an application.
It has three benefits summarized in the given table.
Processes and
Programs
IMPLEMENTING PROCESSES
Accordingly, the kernel allocates resources to a process, protects the process and
its resources from interference by other processes, and ensures that the process
gets to use the CPU until it completes its operation.
Implementing
Processes
Implementing
Processes
A state transition for a process P is a change in its state. A state transition is caused
by the occurrence of some event such as the start or end of an I/O operation. When
the event occurs, the kernel determines its inuence on activities in processes, and
accordingly changes the state of an affected process.
The figure diagrams the fundamental state transitions for a process. A new process
is put in the ready state after resources required by it have been allocated. It may
enter the running, blocked, and ready states a number of times as a result of
events.
Implementing
Processes
Implementing
Processes
Implementing
Processes
Implementing
Processes
Solution
Question
Implementing
Processes
Implementing
Processes
Implementing
Processes
Implementing
Processes
Implementing
Processes
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.
The dispatching function sets up the context of the selected process, changes its
state to running, and loads the saved CPU state from its PCB into the CPU.
Ex:
An OS contains two processes P1 and P2, with P2 having a higher priority than P1. Let P2
be blocked on an I/O operation and let P1 be running. The actions taken place when the
I/O completion event occurs for the I/O operation of P2.
?
?
?
?
?