You are on page 1of 5

System call happens when a computer program requests a service

from the kernel of the operating system on which it is executed.

Multiprocessing

● Processes get executed at the same time.

(Computer hardware and software architecture)


Systems with more than one processor/CPUs.

Asymmetric: Each processor is assigned


a specific task.
A boss processor controls the system.
The boss processor schedules and allocates work to the worker
processors.

Symmetric: each processor performs all tasks within the operating


system
no boss–worker relationship exists
between processors.

Multiprogramming (Non preemptive)

Non-preemptive- Execution only one after the other.

● Processes get executed one after the other unless it


needs an input.
● Multiprogramming operating system has the ability to
execute multiple programs using only one processor
machine.

Deadlock
● Deadlock is a situation where more than one process is blocked
because each process is holding a resource and waiting for
another resource held by some other process.

Deadlock characteristics

● Mutual exclusion: One or more than one resource is


non-shareable within processes.
● Hold and wait: one process holds a resource and is waiting for
another resource which is held by another process.
● No preemption: A resource cannot be taken from a process
unless the process releases the resource.
● Circular wait: A set of processes are waiting for each other in
circular form.
All these conditions must occur for a deadlock to happen.

Deadlock recovery

The process termination method.


● Aborting all the deadlock processes: Breaks the deadlock cycle
but has to re-compute the results of the processes.
● Abort one process at a time until the deadlock cycle is
eliminated: You need to do deadlock-detection after each process
if aborted and make sure no more deadlocks are there.

Deadlock Prevention

● Set of methods to ensure that at least one of the necessary


conditions for a deadlock cannot hold. By forcing how the requests
for resources can be made.

Deadlock Avoidance

● Operating systems are given additional information in advance


regarding which resource a process will request and use until it
releases it.

Safe state

A state is safe if the system can allocate resources to each process (up
to its maximum) in some order and still avoid a deadlock.

Banker’s algorithm

Data structures used for bankers algo:


Available: Indicates the number of available resources of each type.
Max: Defines the maximum demand of each process.
Allocation: Defines the number of resources of each type, currently
allocated to each process.
Need(Max-Allocation): Indicates the remaining resource needed for
each process.

Process State
PCB

Contains information on processes. Used to track the processes


PCB) contains information about the process, i.e. registers, quantum,
priority, etc.
Context Switching

It is a method to store/restore the state of a CPU in a PCB. So


that process execution can be resumed from the same point at
a later time.

You might also like