0% found this document useful (0 votes)
13 views

CSC 504 - Lecture Series - Scheduling in Multiprocessor Systems

Uploaded by

tobianimashaun99
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

CSC 504 - Lecture Series - Scheduling in Multiprocessor Systems

Uploaded by

tobianimashaun99
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

CSC 504 LECTURE SERIES

Process Scheduling in
Multiprocessor systems
LECTURE SERIES
DR. OLADEJI F.A
SINGLE processor SCHEDULING
SCHEME
• FCFS, PRIORITY, SJF, SPJF, lifo,
• Waiting time, turnaround time,  Gantt chart
Class interaction
Assignment of Processes to
Processors
• Static - Process is permanently assigned to a processor for the life
time of the process. Dedicated short-term queue maintained for each
processor. Less overhead in scheduling. Allows Group or Gang
scheduling. However, some processors could be idle.
• Dynamic - Processes reside on one Global queue & scheduled to
available processor.

• Hard affinity versus soft affinity


Single-processor on board case
• Being only one processor, one RAM to hold processes, no contest for
shareable devices
• Methods use are:
• FIFO/LIFO
• Shortest/longest job first
• Round robin/weighted round robin/deficit round robin
• Priority (pre-emptive /non-preemptive)
• Shortest/longest remaining time first
Some of these may not work well in multiprocessing environments
Approaches in Multi processors, one
RAM or individual RAM on board
• Master/Slave Approach
• Key kernel functions of the OS always run on a particular processor;
other processors run only user programs. The master is responsible
for job scheduling and has control of all memory and I/O resources.
• - Conflict resolution simplified; but
• - Failure of master brings down the whole system
• - Master can become a performance bottleneck.
• Peer Approach
• OS can execute on any processor, and each processor does self­-
scheduling from the pool of available resources. - OS to ensure that
two processors do not choose the same process & that processes are
not lost on the queue.
• Mixed approaches
• - Provide a subset of processors dedicated to kernel processing
instead of just one
• - Manage the difference between the needs of kernel processes
& other processes on the basis of priority and execution history.
Difference between a thread and a
program/ a process?
• Thread Scheduling : This can take the form of
• Self scheduling - Each processor when idle selects a thread from a
Global queue of ready threads
• Gang scheduling: A set of related threads is scheduled to run on a set
of processors a the same time, on a one-to-one basis.
• Dedicated processor assignment - Opposite of self ­scheduling,
approach and provides implicit scheduling defined by the assignment
of threads to processors.
Problems with scheduler in a
multiprocessor environment
• Inefficient allocation may result to:
• Contentions
• Imbalance of allocation
• Starvation of process to use processor
• System failure may result to high processing delay
• Unnecessary queuing delay, low performance

Most times, a dynamic scheduler re-adjust the distributions of processes to free


the un-responding systems ( migration) or redistribute the already assigned
processes, (load balancing)
Process Migration
• This is defined as the transfer of the state of a process from one
machine to a target machine for execution.
• It was first or primarily developed as a way of sharing or balancing
work loads amongst various computers in a networked environment.
• However, today other motivations other than loading balancing exist
for process migration

• Process migration is an attempt to load balance he processes. Discuss.


Reasons for migration
1. Load sharing
- Measure load on systems
- Move from heavily loaded system to less loaded system
- Minimize communication to optimize performance
2. Communications performance
• Processes that interact frequently can· be moved to one machine in order to reduce communication cost.
3. Availability
• If a system is to be shut down & the time this is to be done is known, then the processes running on that
system may have to be migrated to another machine to continue running, instead of restarting the process
afresh.
• 4. Utilizing special capabilities
- Capabilities not available or sufficient on current machine
Process Migration Mechanism
• Some questions that could lead to thorough understanding of the
mechanisms are:
• How do you achieve migration?
• Who initiates migration?
• What is migrated?
• What happens to outstanding messages & signals?
• Who initiates Migration?
• Operating system module monitoring system load for all systems and
determines where to migrate and what
• A process may migrate itself in order to obtain a specific resource - to reach
particular resources.
• Hard affinity process cannot be migrated, the system working on them
must finish with them
• Soft affinity processes can be migrated to complete on other system
remote or near
• What is migrated?
• What is to be migrated is the Process Image
• A process consists of four 4 components:
• * An executable program
• * The associated data needed by the program (variables, workspace, buffers etc .)
• * The execution context of the program
• - Contents of various processor registers
• - Priority of the process
• - State of process (running, ready, suspended etc.)
• * Process Control Block (PCB)
• Information about each process is stored in the PCB.
• The PCB typically consists of :
• - unique process identifier to each process
• - address space required by the process (programs & data)
• - initialization of process state, and other processor control information
• - appropriate linkages with other processes
• -accounting information for billing and/or performance assessment purpose.
Movement of Address space during
migration
• Major problem concerns the migration of address space of the PCB in
a Virtual memory scheme. Two approaches:
• Transfer of the whole address space at the time of migration - useful
when most of the non-resident address space will be accessed. Most
of the time piecemeal transfer of blocks would be inefficient
• Transfer portion of address space in main memory; other blocks of
the virtual memory can be transferred on demand . This is useful
when the process will not use much of its non-resident address space
but it requires the source machine to be involved throughout the life
of process . it is also useful when processes are structured as threads

You might also like