Sie sind auf Seite 1von 21

BITI / S1G1 OPERATING SYSTEMS (BITS 1213) LECTURER`S NAME : DR.

NURUL AZMA ZAKARIA

GROUP MEMBERS SOO PHENG KIAN ANDY LOW FOO HWA MOHAMAD ALIFF AIMAN BIN YUSOF NUR AFIQAH BINTI ABDUL RAHMAN B031210015 B031210343 B031210368 B031210210

Uniprocessor Scheduling
To assign processes to be executed by the processor or processors High throughput
Number of processes completed per unit time

High processor efficiency


Ideally the CPU mould be busy 100% of time

Low respond time


Time taken for an interactive program from giving the command to the commence of a respond to the command.

Low waiting time Low turnaround time


Time required for a particular process to complete.

Type of Processor Scheduling

Long-term: Medium-term: Short-term:

which process to be admitted which process to swap in or out which ready process to execute next

Priorities
Scheduler will always choose a process with high priority 1st over the low priority process Have multiple queues to represent each level of priority 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 to ready state by OS -Allow for better service to avoid 1 process monopolize the processor very long

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 nonpreemptive.
Preemptive: will preempt the currently executing process Non-preemptive: allow the currently running process to finish its CPU burst.

Shortest Remaning Time

Process with the shortest expected CPU burst time will be process 1st. A process may preempt when another process become ready. The decision mode is preemptive. I/O bound process will be picked 1st.

MULTIPROCESSOR SCHEDULING
Can

be classify multiprocessor system as :

Loosely coupled / distributed multiprocessor / cluster specialized processors

each processor having its own memory and I/O channel. Functionally

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 Fine Medium Coarse Very Coarse Independent

Description Parallelism inherent in a single instruction stream Parallel processing or multitasking within a single application Multiprocessing of concurrent processes in a multiprogramming environment Distributed processing across network to form a single computing environment Multiple unrelated processes

Synchronization Interval <20 20-200 200-2000 2000-1M Not applicable

o Design Issues

Assignment of processes to processors

the question arise about to whether the assignment should be static or dynamic.

The use of multiprogramming on individual processors

for individuals processor should be able to switch among a number of processes to achieve high utilization and therefore better performance but not for medium-grained application. 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.

Process dispatching

Process Scheduling
Processes are not dedicated to processors.
A single queue for all processor, or if some sort of priority scheme is used, there are multiple queues based on priority. Can view the system as being a multiserver queuing architecture.

Thread Scheduling
Load sharing Process are not assigned to a particular processor. A global queue of ready threads is maintained, and each processor , when idle, selects a thread from the queue.

i. ii. iii. i. ii. iii.

First-come-first-served
Smallest number of threads first Preemptive smallest number of threads first Disadvantage of load sharing Central queue needs mutual exclusion Preemptive threads are unlikely resume execution on the same processor If all threads are in the global queue, all threads of a program will not gain access to the processors at the same time

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.

Real Time Computing


Correctness of system depends to the logical result and the time which 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 even if 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.

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

User Control # Its includes user specifies priority,specify paging,what processes 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 tasks execute.

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

Operating system is responsible for using disk drive efficiently,

having a fast 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, divided

by the total time between the first request for service and the completion 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

First Come First Serve(FCFS)


Request run sequentially.
All processes are fair. Random scheduling if there are many

processes.
Also can be known as First In First Out(FIFO).

Shortest Seek Time First(SSTF)

Selects the request with the minimum seek time from the current head position.
May cause starvation of some requests. Job on the far end will starve whereas closest job will keep getting serviced.

Elevator Algorithm or SCAN


The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues.
Avoids starvation. Provides good performance. Fair to all request/job.

C-SCAN

Provides a more uniform wait time than SCAN.


The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.

C-LOOK

Version of C-SCAN
Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk.

Comparison and Conclusion


Performance depends on the number and types of

requests. Requests for disk service can be influenced by the fileallocation method. The disk-scheduling algorithm should be written as a separate module of the operating system, allowing it to be replaced with a different algorithm if necessary. SSTF is common and has a natural appeal SCAN and C-SCAN perform better for systems that place a heavy load on the disk. SSTF or LOOK is a reasonable choice for the default algorithm.

Das könnte Ihnen auch gefallen