Operating-Systems-Notes

Process and Process Management

Process: Instance of an executing program.

Process is a state of a program when executing and loaded in memory (active state) as opposed to application (static state).

What does a process look like?

Process

Type of state

How does the OS know what a process is doing?

Using:

Process Control Block (PCB)

PCB

How is PCB used ?

howpcbisused

Context Switch

When a cache is HOT, most process data is in the cache so the process performance will be at its best.

Sometimes there are situations where we have to Context Switch (higher priority process, timesharing, etc.)

Process Lifecycle

processlifecycle

CPU is able to execute a process when the process is in Running or Ready state.

Process Creation

Mechanisms:

What is the role of CPU scheduler?

CPU scheduler determines which one of the currently ready processes will be dispatched to the CPU to start running, and how long it should run for.

OS must :

Scheduling design decisions

timeslice

I/O

A process can make way in the ready queue in a number of ways.

io

Can process interact?

Inter Process communication:

IPC mechanisms:

Two types of IPC models:

1. Message Passing IPC

messagepassing

Advantages: OS manages the channel
Disadvantages: Overheads

2. Shared Memory IPC

sharedmemory

Advantages: OS is out of the way after establishing the shared channel
Disadvantages: Re-implementing a lot of code that could have been done by the OS

Overall, shared memory based communication is better if mapping memory between two processes is ammortized over a large number of messages.