操作系统(Operating System)10

本文探讨了多处理器系统的分类及同步粒度的概念,并讨论了多处理器调度中的关键问题,包括进程分配、多道程序设计及实际分配。文章还介绍了几种不同的架构如Master/Slave和Peer架构,以及几种调度方法如负载分配、组调度、专用处理器分配和动态调度。

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

### 麒麟操作系统安装时出现 'Operating System not found' 的解决方案 当在 VM 虚拟机环境中尝试安装麒麟操作系统并遇到 `Operating System not found` 错误时,通常是因为虚拟机未正确加载 ISO 映像文件或者配置不完整所致。以下是针对该问题的具体分析和解决办法: #### 1. **确认虚拟机设置** 确保虚拟机已正确配置启动设备顺序。通过编辑虚拟机设置,调整 BIOS 启动优先级,使光驱(CD/DVD 或 ISO 文件)成为首选启动项[^1]。 ```plaintext 具体操作步骤: - 打开虚拟机软件(如 VMware Workstation/Player 或 VirtualBox)。 - 右键点击目标虚拟机 -> 编辑虚拟机设置。 - 进入“选项”->“高级”,检查引导顺序是否设置了 CD/DVD 为第一启动项。 ``` #### 2. **验证 ISO 镜像文件的有效性** 错误可能源于使用的 ISO 镜像文件损坏或版本不适配。建议从官方渠道重新下载最新的麒麟操作系统镜像文件,并校验其 MD5 值以确保完整性[^2]。 ```bash # 使用以下命令计算本地 ISO 文件的 MD5 校验值并与官网提供的一致性对比 md5sum kylin-os.iso ``` #### 3. **指定正确的 ISO 映像路径** 如果 ISO 文件路径未被正确定位,则可能导致系统无法识别启动介质。需手动指定 ISO 文件的位置,并确保虚拟机能够访问它[^4]。 ```plaintext 具体操作步骤: - 返回到虚拟机设置窗口中的“硬件”部分。 - 添加一个新的 CD/DVD 设备。 - 将模式更改为“使用 ISO 映像文件”。 - 浏览至存储有合法麒麟 OS 镜像文件的目录完成关联绑定。 ``` #### 4. **检查虚拟硬盘状态** 有时即使提供了有效的启动媒介仍会出现此提示,可能是由于虚拟硬盘尚未初始化或格式化不当引起。创建新的虚拟硬盘或将现有磁盘重置后再试一次可能会解决问题[^3]。 --- ### 示例代码片段:自动挂载ISO脚本 (适用于某些环境) 对于批量部署场景下频繁更换不同OS镜像的情况,可编写简单脚本来简化流程: ```python import os def mount_iso(iso_path, vm_name): command = f"vmrun -T ws connectCdrom {vm_name} {iso_path}" result = os.system(command) if result == 0: print(f"{vm_name}'s cdrom successfully mounted with {iso_path}.") else: print("Failed to mount the iso file.") if __name__ == "__main__": iso_file_location = "/path/to/kylin-os.iso" virtual_machine_identifier = "KylinVM" mount_iso(iso_file_location, virtual_machine_identifier) ``` --- #### 总结 上述方法涵盖了大部分因配置失误引发的操作系统找不到类别的常见原因处理方式。实际应用过程中可根据具体情况灵活选用其中一种或多组合策略来排除故障。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值