Lec 13OS

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Microsoft Word (running many modules concurrently)

1. Is each functionality a separate process?

2. If yes, how do they communicate?

3. IPC : Easy but a lot of overhead, suitable for sharing small volumes of data

4. Flooding of processes

Image source: Geeksforgeeks


If multiple processes work on a big pool of shared
data, keep them in one process!!!

Intra-process context switch !!!


Thread Control Blocks (Where are they?)
User level threads vs. Kernel level threads
User level threads vs. Kernel level threads

Can’t utilise multiple


cores
Slide source: https://www.inf.ed.ac.uk/
Best of both worlds (Hybrid Approach)
Dynamic system of threads and processes

SCHEDULING on SYNCHRONIZATION
MULTIPROCESSORS PRIMITIVES
Multiprocessor Scheduling
Multiprocessor Scheduling (Homogenous)

Migrating Processes can create troubles !!

Should I stop migration altogether?


Multiprocessor Scheduling (Homogenous)

1. Who will run the scheduler?


2. Will one ready queue suffice?
Who will run the scheduler ?

1. Asymmetric multiprocessing : Master processor distributes tasks to slaves


a. Slaves have to wait
2. Symmetric Multiprocessing : Everyone is its own master!!
a. Global ready queue
i. Shared data (Race condition)
b. Private ready queue
Multiprocessor Scheduling

Which CPU should run the scheduler?


Multiprocessor Scheduling

Which CPU should run the scheduler?

1. Symmetric vs Unsymmetric
2. Symmetric: How many ready queues?
Heterogeneous Multiprocessor Scheduling (DAG, NP-hard)
Real Time Scheduling : Not fair

1. Meet task deadlines, instead of throughput, waiting time and response time, etc.

2. If you have five homework assignments and only one is due in half an hour, you work
on that one first. Don’t try to be fair to all.

Rocket-control task
The track correction task starts 2000 milliseconds after the launch of the rocket, and
recurs periodically every 50 milliseconds then on. Each instance of the task requires a
processing time of 8 milliseconds and its relative deadline is 50 milliseconds.
Rate Monotonic Scheduling
The Critical Section

Slide source:binary terms


Critical Section Requirements

1. Mutual Exclusion
2. Progress (don’t write a program with fixed access time for different processes)
3. Bounded Waiting (No starvation)
References
1. https://people.cs.rutgers.edu/~pxk/416/notes/07-scheduling.html

You might also like