Upload
darrel-soo-pheng-kian
View
313
Download
1
Embed Size (px)
Citation preview
7/28/2019 OS Mini Project
1/21
BITI / S1G1
OPERATING SYSTEMS
(BITS 1213)
GROUP MEMBERS
SOO PHENG KIAN B031210015
ANDY LOW FOO HWA B031210343
MOHAMAD ALIFF AIMAN BIN YUSOF B031210368
NUR AFIQAH BINTI ABDUL RAHMAN B031210210
LECTURER`S NAME : DR. NURUL AZMA ZAKARIA
7/28/2019 OS Mini Project
2/21
7/28/2019 OS Mini Project
3/21
Type of Processor Scheduling
Long-term: which process to be admitted
Medium-term: which process to swap in or out
Short-term: which ready process to execute next
7/28/2019 OS Mini Project
4/21
Priorities
Scheduler will always choose a process with highpriority 1st over the low priority process
Have multiple queues to represent each level ofpriority
Lower priority may suffer starvation- allow a low priority process to change its priority based on its ages and
execute history
Decision mode Non-preemptive: When a process is in running state, it will continue
until it is terminated or block itself for I/O
Preemptive: -currently running process will be interrupted and move toready state by OS
-Allow for better service to avoid 1 process monopolize theprocessor very long
7/28/2019 OS Mini Project
5/21
Shortest-Job-First Scheduling(SJF)
To pick a quickest fastest little job that need to
be done and get it out 1st, and pick the next
smallest faster job to do next.
The SJF algorithm can be preemptive or non-
preemptive.
Preemptive: will preempt the currently executing process
Non-preemptive: allow the currently running process tofinish its CPU burst.
7/28/2019 OS Mini Project
6/21
Shortest Remaning Time
Process with the shortest expected CPU burst time will
be process 1st.
A process may preempt when another process becomeready.
The decision mode is preemptive.
I/O bound process will be picked 1st.
7/28/2019 OS Mini Project
7/21
MULTIPROCESSOR SCHEDULING
Can be classify multiprocessor system as :
Loosely coupled / distributed multiprocessor / cluster
each processor having its own memory and I/O channel.Functionally specialized processors
controlled by the master and provide services to it.
Tightly coupled multiprocessor
set of processors that shared main memory and under control of operating system.
oGranularity
Grain Size Description Synchronization
Interval
Fine Parallelism inherent in a single instruction stream
7/28/2019 OS Mini Project
8/21
Assignment of processes to
processors
the question arise about to
whether the assignment should bestatic or dynamic.
The use of multiprogramming onindividual processors
for individuals processor should beable to switch among a number of
processes to achieve high utilization
and therefore better performance but
not for medium-grained application.
Process dispatching the use of priorities or of
sophisticated scheduling algorithms
based on past usage may improve
performance over a simple-minded
first-come-first-served strategy.
o Design Issues
7/28/2019 OS Mini Project
9/21
7/28/2019 OS Mini Project
10/21
Gang Scheduling
A set of related threads is scheduled to run on a set of processors at the same time, on a
one-to-one basis
Dedicated processor assignment
This is the opposite of the load-sharing approach and provides implicit scheduling
defined by the assignment of threads to processors. Each program, for the duration of its
execution, is allocated a number of processors equal to the number of threads in the
program. When the program terminates, the processors return to the general pool for
possible allocation to another program.
Dynamic Scheduling
the number of threads in a process can be altered during the course of execution.
7/28/2019 OS Mini Project
11/21
Real Time Computing
Correctness of system depends to the logical result and the timewhich the results are produced.
Hard Real-Time Task
We must meet its deadline,otherwise fatal damage r error will occur
Soft Real-Time Task
We should meet is deadline but not mandatory and schedule it evenif the deadline is already passed.
Aperiodic Test
Random task which may have a constraint on start or finish time or
both.
Periodic Task
A sequence of tasks which appear once per period T.
7/28/2019 OS Mini Project
12/21
Determnistic
# Operations are performed at fixed,predetermined times or within
predetermined time intervals
# Concern how long the OS delays before acknowledging an interrupt
# Maximal delay is small
Responsiveness
# How long,after acknowledgment,it takes the OS to service the
interrupt.
# This includes
-Amount of time to begin execution of the interrupt
-Amount of time to perform the interrupt
7/28/2019 OS Mini Project
13/21
User Control
# Its includes user specifies priority,specify paging,whatprocesses must always reside in main memory,disks
algorithms to use and rights of processes.
Reliability
# More important for real-time system than regular system
# Error generally not recoverable# Attempt either to correct the problem or minimize is effects
while continuing to run and most critical,high priority tasksexecute.
7/28/2019 OS Mini Project
14/21
Fast process/thread switch
Small size
Ability to respond to external interrupts
quickly Preemptive scheduling base on priority
Delay tasks for fixed amount of time
Special alarms and timeouts
7/28/2019 OS Mini Project
15/21
Operating system is responsible for using disk drive efficiently,having afast access time and disk bandwidth.
Access time has 2 major components.->time for the disk to move the heads to the cylinder
containing desired sector.-> additional time waiting for the disk to rotate the
desired sector to the disk head.
Disk Bandwidth is the total number of bytes transferred, dividedby the total time between the first request for service and thecompletion of the last transfer.
To minimize seek time.
Seek time Seek distance
For example, we take a request queue (0-199).
98, 183, 37, 122, 14, 124, 65, 67
Initial value=53
7/28/2019 OS Mini Project
16/21
First Come First Serve(FCFS)
Request runsequentially.
All processes are fair.
Random scheduling ifthere are many
processes.Also can be known asFirst In First Out(FIFO).
7/28/2019 OS Mini Project
17/21
Shortest Seek Time First(SSTF)
Selects the requestwith the minimumseek time from thecurrent headposition.
May cause starvationof some requests.
Job on the far endwill starve whereasclosest job will keepgetting serviced.
7/28/2019 OS Mini Project
18/21
Elevator Algorithm or SCAN
The disk arm starts atone end of the disk, andmoves toward the otherend, servicing requestsuntil it gets to the otherend of the disk, where
the head movement isreversed and servicingcontinues.
Avoids starvation.
Provides good
performance.Fair to all request/job.
7/28/2019 OS Mini Project
19/21
C-SCAN
Provides a moreuniform wait timethan SCAN.
The head movesfrom one end of thedisk to the other.servicing requests asit goes. When itreaches the otherend, however, itimmediately returns
to the beginning ofthe disk, withoutservicing anyrequests on thereturn trip.
7/28/2019 OS Mini Project
20/21
C-LOOK
Version of C-SCAN Arm only goes as far
as the last request ineach direction, thenreverses directionimmediately,without first going allthe way to the end ofthe disk.
7/28/2019 OS Mini Project
21/21
Comparison and Conclusion
Performance depends on the number and types ofrequests.
Requests for disk service can be influenced by the file-allocation method.
The disk-scheduling algorithm should be written as aseparate module of the operating system, allowing it tobe replaced with a different algorithm if necessary.
SSTF is common and has a natural appeal
SCAN and C-SCAN perform better for systems thatplace a heavy load on the disk.
SSTF or LOOK is a reasonable choice for the defaultalgorithm.