Chapter-2-Processes and Process Management
Chapter-2-Processes and Process Management
By Abebaw S.
Outline
Process and Thread
The concept of multi-threading
Inter process communication
Race conditioning
Critical Sections and mutual exclusion
Process Scheduling
Preemptive and non preemptive scheduling
Scheduling policies
Dead lock
Deadlock prevention
Deadlock detection
Deadlock avoidance
Process concept
Process can be defined as
Unit of work
It is a program in execution.
it, the compiler creates binary code. The original code and
binary code are both programs. When we actually run the
binary code, it becomes a process.
Process (continue . . . )
A single program can create many processes. For
example, when we open binary file multiple times,
multiple processes are created.
Difference between program and process
Program Process
Def: collection of Def: an instance of an
instructions designed to running program.
accomplish a certain task. Nature: active entity.
Nature: passive entity. Lifespan: limited.
Lifespan: much higher
Process (continue . . . )
Differences (Continue …)
Program Process
Resource: require Resource: It requires CPU,
only memory space to memory address, disk,
store the instructions. Input/output during its
Computation Time: lifetime.
has no computation Computation Time: Takes
time and cost. a long time to access and
compute a single fact.
Process (continue . . . )
In main memory, a process has
four sections:
Text: consists of the current
static variables.
Fig: Process in Memory
Process (continue . . . )
destroying threads.
Doesn’t recognized by OS .
Take less time for context switching.
Can be created and managed quickly.
Example: Java thread
Types of Thread (Continue . . .)
Advantages
Simple and quick to create.
privileges.
If a thread in the kernel is blocked, it does not block all other
halted.
Types of Thread (Continue . . .)
Kernel level threads (Continue . . .)
Managed by OS.
Multithreading is compatible
Complicated implementation.
Take more time to context switching
Hardware support is needed.
If one kernel thread performs a blocking operation
Disadvantage: