Process state................................................................................................................................................3
Inter-process communication......................................................................................................................4
Race condition.............................................................................................................................................6
Critical sections............................................................................................................................................8
Mutual exclusion.........................................................................................................................................9
System calls..................................................................................................................................................9
How System Call Operate.........................................................................................................................9
Semaphores and Monitors.........................................................................................................................10
Semaphores:..........................................................................................................................................10
Counting Semaphore.........................................................................................................................11
Binary Semaphore..............................................................................................................................11
Monitors:...............................................................................................................................................13
Process Scheduling in OS..........................................................................................................................15
1. Long-term scheduler......................................................................................................................15
2. Short-term scheduler.....................................................................................................................16
3. Medium-term scheduler................................................................................................................16
Schedulers.................................................................................................................................................18
Deadlock....................................................................................................................................................19
Methods of Handling Deadlock.................................................................................................................20
Description of an error diagnosis...............................................................................................................21
, ADVANCED PROCESS MANAGEMENT
1. Definition of process management.
In the context of an operating system, process management refers to the activities and techniques
involved in the creation, scheduling, execution, and termination of processes within the system. It
encompasses the control and coordination of multiple concurrent processes, ensuring efficient resource
allocation, and providing a structured environment for executing tasks.
Process management in an operating system typically involves the following key components:
1. Process Creation: This step involves creating new processes within the system. The operating
system allocates the necessary resources, such as memory space, for the new process and
initializes its data structures. Process creation may occur as a result of user requests, system
initialization, or the spawning of child processes by existing processes.
2. Process Scheduling: Once processes are created, the operating system determines the order and
manner in which they are executed. Process scheduling algorithms are used to select the next
process to run from the pool of ready processes. The goal is to efficiently utilize system
resources, maximize throughput, and provide fair access to the CPU.
3. Process Execution: When a process is selected for execution, the operating system allocates CPU
time to that process, allowing it to run its instructions. The operating system manages context
switching between processes, saving and restoring their states as necessary.
4. Process Termination: Processes may terminate either voluntarily or involuntarily. When a process
completes its execution or explicitly requests termination, the operating system releases the
allocated resources and performs necessary cleanup tasks. In cases of abnormal termination, such
as a critical error or violation of system policies, the operating system may forcibly terminate a
process.
5. Process Synchronization and Communication: In a multi-process environment, processes may
need to synchronize their activities or communicate with each other. The operating system
provides mechanisms, such as semaphores, mutexes, and message queues, to facilitate inter-
process communication and coordination.
6. Process Monitoring and Control: The operating system is responsible for monitoring the
execution of processes and enforcing system policies. It tracks the state, resource usage, and
performance of processes, allowing administrators to manage and control their behavior. This
includes handling process priorities, enforcing security restrictions, and preventing undesirable
activities.
, Effective process management in an operating system is crucial for ensuring resource efficiency,
responsiveness, and stability.
Process state
The term "process state" in the context of an operating system describes the state or stage at which a
given process is currently executing. The operating system monitors the condition of the process in order
to properly manage and regulate it during execution and allot system resources. The process state often
includes a number of predetermined states, such as:
a) New: This is the first stage of the creation of a process that has not yet begun execution. In this
condition, the operating system prepares the process for execution by allocating the required
resources to it.
b) Ready: When a process is in the ready state, it is waiting to be executed by the CPU. The process
has been loaded into the main memory and is capable of running, but it is waiting for the CPU
scheduler to allocate CPU time for execution.