Beruflich Dokumente
Kultur Dokumente
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
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.
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
each processor having its own memory and I/O channel. Functionally
Tightly
coupled multiprocessor
set of processors that shared main memory and under control of operating system.
oGranularity
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
o Design Issues
the question arise about to whether the assignment should be static or dynamic.
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.
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.
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
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.
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
processes.
Also can be known as First In First Out(FIFO).
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.
C-SCAN
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.
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.