Process Management: Name: Imran Ahsanullah Roll#: sp20mcs0023 Name: Rahoul Roll #: Sp20-Bsse-1025
Process Management: Name: Imran Ahsanullah Roll#: sp20mcs0023 Name: Rahoul Roll #: Sp20-Bsse-1025
Process Management: Name: Imran Ahsanullah Roll#: sp20mcs0023 Name: Rahoul Roll #: Sp20-Bsse-1025
Name: Rahoul
Roll #: sp20-bsse-1025
PROCESSES AND PROGRAM
What is a Process?
Implementing Processes
Process States and State Transitions
Process Context and the Process Control Block
Context Save, Scheduling and Dispatching
Event Handling
Sharing, Communication and Synchronization between Processes
Processes and Programs
Relationship between Processes and Programs
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 influence 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
Process States and State Transitions Continue…
Implementing Processes
Process States and State Transitions Continue…
Implementing Processes
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.
Concurrency and Parallelism
Concurrency means executing multiple tasks at the same time but not necessarily
simultaneously.
There are two tasks executing concurrently, but those are run in a 1-core CPU, so the CPU will decide to run a
task first and then the other task or run half a task and half another task, etc.
Two tasks can start, run, and complete in overlapping time periods i.e Task-2 can start even before Task-1
gets completed. It all depends on the system architecture..
Concurrency means executing multiple tasks at the same time but not necessarily simultaneously
Concurrency: Interruptability
Parallelism is when tasks literally run at the same time, e.g., on a multicore processor
Parallelism means that an application splits its tasks up into smaller subtasks which can be processed in
parallel, for instance on multiple CPUs at the exact same time
Parallelism does not require two tasks to exist. It literally physically run parts of tasks OR multiple tasks, at the
same time using the multi-core infrastructure of CPU, by assigning one core to each task or sub-task
Parallelism: Independentability
Process Scheduling Goals
1. Long-term scheduling
Long-term scheduling is done when a new process is created. It initiates processes and so
controls the degree of multi-programming (number of processes in memory).
2. Medium-term scheduling
Medium term scheduling Medium-term scheduling involves suspending or resuming processes by
swapping (rolling) them out of or into memory
3. Short-term scheduling
Short-term (process or CPU) scheduling occurs most frequently and decides which process to
execute next
Scheduling Algorithms
2. Priority Scheduling