操作系统(Operating System)10

CH10
Multiprocessor/Multicore & Realtime Scheduling
多处理器和实时调度

Classifications of Multiprocessor Systems
1.Loosely couple or distributed multiprocessor, or cluster
2.Functionally specialized processors
3.Tightly coupled multiprocessor

A good way to describe multiprocessor is using Synchronization Granularity.
1.Independent Parallelism
独立平行,无约束,处理器之间互不干扰去世隔绝
2.Coarse and Very Coarse Grained Parallelism
3.Medium-Grained Parallelism
Simple application can be effectively implemented as a collection of threads within a single process.
4.Fine-Grained Parallelism细粒度并行性
Represents a much more complex use of parallelism than is found in the use of threads
Is a specialized and fragmented area with many different approaches
Valve gaming engine

10.1.2 Design Issues
设计问题
多处理器中的调度涉及三个相互关联的问题
1.把进程分配到处理器
2.在单处理器上使用多道程序设计
3.一个进程的实际分配
Assignment of Processes to Processors
a) assuming all processors are equal, assign it to processors on demand.(static or dynamic?)
b) a dedicated short-term queue is maintained for each processor.
(advantage: less overhead in the scheduling function)
(disadvantage: one processor can be idle, with an empty queue)
to prevent this situation, a common queue can be used
another option is dynamic load balancing
不管是静态还是动态都需要一些分配进程给处理器的方法。

Approaches:
-Master/Slave
-Peer

Master/Slave Architecture大师和奴隶架构
奴隶是一些个进程,想要运行时要问问主人,主人会选一个奴隶执行。
缺点:1.主人死了程序就崩溃了
2.瓶颈在主人,主人要是比较傻一家都傻

Peer Architecture贵族架构!
Kernel can execute on any processor
Each processor does self-scheduling from the pool of available processes
操作系统能在任何一个处理器上运行,处理器可以从进程池中进行自调度。
(must ensure that two processors do not choose the same process and that the processes are not somehow lost from the queue)

10.1.3 Thread Scheduling进程调度
Approaches to Thread Scheduling:
Load Sharing负载分配
Gang Scheduling 组调度
Dedicated Processor Assignment 专用处理器分配
Dynamic Scheduling 动态调度

load Sharing
10.1
分享加载的不足之处:
Central queue occupies a region of memory that must be accessed in a manner that enforces mutual exclusion
can lead to bottlenecks瓶颈
Preemptive threads are unlikely to resume execution on the same processor由于进程被强占后可能会在不同处理器上继续运行,就会对处理器的高速缓存造成浪费
caching can become less efficient
If all threads are treated as a common pool of threads, it is unlikely that all of the threads of a program will gain access to processors at the same time
the process switches involved may seriously compromise performance

Gang Scheduling组调度
同时在一组处理器上调度一组进程
Useful for medium-grained to fine-grained parallel applications whose performance severely degrades when any part of the application is not running while other parts are ready to run
Also beneficial for any parallel application

Dedicated Processor Assignment专用处理器分配
把一个处理器专门分配给一个应用程序,他的每一个线程都被分配个一个处理器。
这种想法看起来会极端浪费处理器时间,但是也有一定的原因:
1.在一个高速并行的系统中,有数十个或数百个处理器,这种担忧微不足道
2.在一个程序的生命周期中避免进程切换会加快程序的执行速度
(私以为,满足两点可以考虑Dedicated Processor Assignment, 1.电脑性能过剩,2.该程序太小)

Dynamic Scheduling动态调度
我也没太理解书上这块说的啥,大概就是分析了一下动态调度的过程:当一个job发送请求时,如果有空闲的处理器,那么就满足他,如果没有,试着从当前的里面分一个给他,如果还不能满足,那就加进一个表里,等有处理器空闲了,就扫描这个表FCFS。

e

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值