1 multiprocessor and real-time scheduling chapter 10 real-time scheduling will be covered in...

18
1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303.

Upload: lee-grant

Post on 02-Jan-2016

216 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

1

Multiprocessor and Real-Time Scheduling

Chapter 10

Real-Time scheduling will be covered in SYSC3303.

Page 2: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

2

Classifications of Multiprocessor Loosely coupled or distributed multiprocessor, or

cluster each processor has its own memory and I/O channels

Functionally specialized processors such as I/O processor controlled by a master processor

Tightly coupled multiprocessing processors share main memory controlled by operating system

What is the main concern in general for multiprocessing? Processor utilization vs. throughput

Page 3: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

Synchronization Granularity and Processes - Summary

3

Page 4: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

4

Independent Parallelism

Separate applications or processes running

No synchronization among processes Example is time sharing

average response time to users is less

Page 5: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

5

Coarse and Very Coarse-Grained Parallelism

Synchronization among processes at a very gross level

Good for concurrent processes running on a multiprogrammed uniprocessor or multiple processors

Distributed processing across network nodes to form a single computing environment

Good when there is infrequent interaction among processes overhead of network would slow down communications

Page 6: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

6

Medium-Grained Parallelism

Parallel processing or multitasking within a single application

Single application is a collection of threads (or processes)

Threads usually interact frequently

Page 7: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

7

Fine-Grained Parallelism

Highly parallel applications Usually much more complex use of parallelism

than is found in the use of threads

Specialized area

Page 8: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

8

Scheduling Design Issues

Scheduling on a multiprocessor involves:

Use of multiprogramming on individual processors Similar to uni-processor scheduling

Assignment of processes to processors

Actual dispatching of a process

Page 9: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

9

Assignment of Processes to Processors

Two approaches: Treat processors as a pooled resource and

assign process to processors on demand A common queue: Schedule to any available processor Local queues: dynamic load balancing

processes or threads are moved from a queue for one processor to a queue for another processor.

Permanently assign a process to a processor Allows group or gang scheduling Dedicate short-term queue for each processor Advantage and disadvantage?

Less overhead in scheduling A processor could be idle while another processor has a backlog

Page 10: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

10

Process Scheduling

Usually processes are not dedicated to processors

Queuing A single queue for all processors Multiple queues based on priorities

All queues feed to the common pool of processors Specific scheduling disciplines is less

important with more than one processor Different scheduling methods can be used for

different processors

Page 11: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

11

Comparison of One and Two Processors – An Example

Page 12: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

12

Thread Scheduling

An application can consist a set of threads that cooperate and execute concurrently in the same address space

Threads running on separate processors could yield a dramatic gain in performance for some applications

Page 13: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

Approaches to Thread Scheduling

13

Load Sharing

Gang Scheduling

Dedicated Processor Assignment

Dynamic Schedulin

g

Four approaches for multiprocessor thread

scheduling and processor assignment

are:

a set of related threads scheduled to run on a set of

processors at the same time, on a one-to-one basis

processes are not assigned to a

particular processor

provides implicit scheduling defined by the assignment of threads to processors

the number of threads in a process can be altered

during the course of execution

Page 14: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

14

Load Sharing

Load is distributed evenly across the processors Simplest and carries over most directly from a

uni-processor system Assures no processor is idle No centralized scheduler required Use global queues

Page 15: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

15

Disadvantages of Load Sharing

Central queue needs mutual exclusion may be a bottleneck when more than one

processor looks for work at the same time Preemptive threads are unlikely to resume

execution on the same processor In a loosely-coupled system, cache usage is

less efficient If all threads are in the global queue, all

threads of a program will not gain access to the processors at the same time

Page 16: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

16

Gang Scheduling

Simultaneous scheduling of related threads that make up a single process

Useful for applications where performance severely degrades when any part of the application is not running Better for dedicated applications Lower scheduling overhead for those processes

Threads often need to synchronize with each other

Number of processors may be smaller than the number of threads on some machines.

Page 17: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

17

Dedicated Processor Assignment

When application is scheduled, its threads are assigned to a processor

Some processors may be idle Avoids process switching

Page 18: 1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303

18

Dynamic Scheduling Number of threads in a process are altered

dynamically by the application Operating system adjusts the load to improve usage

assign idle processors new arrivals may be assigned to a processor that is used

by a job currently using more than one processor hold request until processor is available new arrivals will be given a processor before existing

running applications