Académique Documents
Professionnel Documents
Culture Documents
Data Structures:
Free list & allocation list
First Fit :
i/p:- required memory?? 50
First-fit: Allocate the first hole that is
big enough
Best Fit :
i/p:- required memory?? 90
Best-fit: Allocate the smallest hole
that is big enough; must search entire
list, unless ordered by size
Worst Fit :
i/p:- required memory?? 90
Worst-fit: Allocate the largest hole;
must also search entire list
De allocation
De allocates the requested process
from allocation list to free list
i/p:- process no
Eg: p1
After de allocation
Process
a program in execution, which forms
the basis of all computation
process execution must progress in
sequential fashion
Program is passive entity, process is
active
Program becomes process when
executable file loaded into memory
Process Scheduling
Maximize CPU use, quickly switch processes
onto CPU for time sharing
Process scheduler selects among available
processes for next execution on CPU
Maintains scheduling queues of processes
Job queue set of all processes in the system
Ready queue set of all processes residing in
main memory, ready and waiting to execute
Device queues set of processes waiting for an
I/O device
Processes migrate among the various queues
CPU Scheduler
Selects from among the processes in ready queue,
and allocates the CPU to one of them
Queue may be ordered in various ways
Nonpreemptive scheduling
Under nonpreemptive scheduling,
once the CPU has been allocated to a
process,
the process keeps the CPU until it
releases the CPU either by terminating
or by switching to the waiting state.
Scheduling Criteria
CPU utilization keep the CPU as busy as possible
Throughput # of processes that complete their
execution per time unit
Turnaround time amount of time to execute a
particular process
Waiting time amount of time a process has been
waiting in the ready queue
Response time amount of time it takes from
when a request was submitted until the first
response is produced, not output (for time-sharing
environment)
P2
24
P3
27
30
P3
P1
30
Example of SJF
P1
P2
P3
P4
SJF
ProcessArr
0.0 6
2.0 8
4.0 7
5.0 3
scheduling chart
P4
P3
P1
3
P2
16
24
Example of Shortest-remainingtime-first
P1
P4
P2
P1
10
P3
17
26
Example of Shortest-remainingtime-first
ProcessA
arri Arrival TimeT Burst Time
P1 0
P2 1
P3 2
P4 3
Increment clk
Priority Scheduling
A priority number (integer) is associated with each
process
The CPU is allocated to the process with the highest
priority (smallest integer highest priority)
Preemptive
Nonpreemptive
P1
P5
P2
1
P3
16
P4
18
19
P2
4
P3
7
P1
10
P1
14
P1
18
22
P1
P1
26
30