U-1 Os Notes
U-1 Os Notes
UNIT-1
LET’S RECALL
PROCESS
MANAGEMENT
Process: Thread:
A process can be thought of as A thread is the unit of execution within a
a program in execution. process. A process can have anywhere
from just one thread to many threads.
PROCESS STATE
*As a process executes, it changes state.
*The state of a process is defined in part by the current activity of that process.
PROCESS CONTROL BLOCK
Direct Communication
Indirect Communication
Direct Communication
Each process which needs to communicate must explicitly name the recipient or
sender of the communication. Here the primitives are defined as:
Send (P, message) - Send a message to process P
Receive (Q, message) - Receive a message from process Q
The properties of communication link are: exactly one link exists between each
pair processes. The processes need to know only each other's identity to
communicate.
Indirect Communication
The messages are sent to and received from mail boxes or ports. Each mail box
has an unique identification. The primitives are:
Send (A, message) - Send a message to mail box A
Receive (A, message) - Receive a message from mail box A
The properties are: A link is established between a pair of processes only if both
members of the pair have a shared mail box. A link may be associated with more
than two processes. A number of different links may exist between each pair of
communicating processes.
3. SYNCHRONIZATION
Message passing may be either blocking or non-blocking
also known as synchronous or asynchronous.
Blocking Send: The sending process is blocked until the
message is received by the receiving process or by the
mail box.
Non blocking Send: The sending process sends the
message and resumes operation.
Blocking Receive: The receiver blocks until a message
is available.
Non blocking Receive: The receiver retrieves either a
valid message or null.
4. BUFFERING
Communicating processes reside in a temporary queue. A queue is
implemented in 3 ways:
Zero Capacity: The queue has maximum length 0. The sender
must block until the recipient receives the message.
Bounded Capacity: The queue has a finite length n. The link
has a finite capacity. If the link is full the sender must block
until space is available in the queue.
Unbounded Capacity: The queue has infinite length. Any
number of messages can wait in it. The sender never blocks.
CPU SCHEDULING
CPU SCHEDULERS
SCHEDULING CRTERIA
MAXIMIZE MINIMIZE
CPU Utilization Turn Around Time
Throughtput Waiting Time
Response Time
CPU UTILIZATION: A Scheduling algorithm should be
designed so that CPU remains busy as possible. It should make
efficient use of CPU
THROUGHPUT: Numbers of processors completed per unit time
ARRIVAL TIME: Time at which the process arrives in the ready
queue
COMPLETION TIME: Time at which the process completes its
execution
BURST TIME: Time required by a process for CPU execution
RESPONSE TIME: The amount of time at takes from when a
request was submitted until the first response is produced
CPU Scheduling Terms and Terminology
Convey Effect:
If the process with higher burst time arrived before the processes
with smaller burst time. Then, smaller processes have to wait for a
long tme for long rocesses to release the CPU
SHORTEST JOB FIRST SCHEDULING
PRIORITY SCHEDULING