前言
大家好!今天我们来系统梳理《计算机操作系统》第十章 ------ 多处理机操作系统的核心知识点。这一章是操作系统进阶的关键内容,不仅要理解概念,更要结合实战代码和架构案例掌握其核心逻辑。全文语言通俗易懂,每个核心知识点都配有C++98 标准的完整可运行代码、实战案例,还附带架构图 / 流程图的生成提示词,方便大家动手实操。
10.1 多处理机系统的基本概念
核心定义
多处理机系统(Multiprocessor System)是指包含多个独立的处理机(CPU) 的计算机系统,这些 CPU 共享内存、I/O 设备等系统资源,协同完成计算任务,核心目标是提升系统的并行处理能力和可靠性。
关键区别(对比单处理机)
| 维度 | 单处理机系统 | 多处理机系统 |
|---|---|---|
| 并行性 | 仅进程 / 线程并发 | 真正的硬件级并行执行 |
| 资源共享 | 单 CPU 独占资源 | 多 CPU 共享内存 / 外设 |
| 任务调度 | 单队列调度 | 多队列 / 全局队列调度 |
| 可靠性 | 单 CPU 故障即宕机 | 部分 CPU 故障仍可运行 |
架构图

实战案例:多处理机系统核心识别(C++98 代码)
#include <iostream>
#include <vector>
// 兼容C++98标准,禁用C++11及以上特性
using namespace std;
// 定义处理机(CPU)类
class CPU {
private:
int id; // CPU编号
bool isBusy; // 是否忙碌
public:
// 构造函数(C++98风格)
CPU(int cpuId) : id(cpuId), isBusy(false) {}
// 执行任务
void executeTask(const string& taskName) {
isBusy = true;
cout << "CPU " << id << " 开始执行任务:" << taskName << endl;
// 模拟任务执行(简化)
isBusy = false;
cout << "CPU " << id << " 完成任务:" << taskName << endl;
}
// 获取CPU状态
bool getBusyStatus() const {
return isBusy;
}
// 获取CPU编号
int getId() const {
return id;
}
};
// 多处理机系统类
class MultiprocessorSystem {
private:
vector<CPU> cpus; // 存储系统中的CPU(C++98支持vector)
public:
// 初始化多处理机系统,指定CPU数量
MultiprocessorSystem(int cpuCount) {
for (int i = 0; i < cpuCount; ++i) {
cpus.push_back(CPU(i)); // C++98 vector push_back
}
}
// 显示所有CPU状态
void showCPUStatus() const {
cout << "\n=== 多处理机系统CPU状态 ===" << endl;
for (vector<CPU>::const_iterator it = cpus.begin(); it != cpus.end(); ++it) {
cout << "CPU " << it->getId() << ":" << (it->getBusyStatus() ? "忙碌" : "空闲") << endl;
}
}
// 分配任务到空闲CPU
bool assignTask(const string& taskName) {
for (vector<CPU>::iterator it = cpus.begin(); it != cpus.end(); ++it) {
if (!it->getBusyStatus()) {
it->executeTask(taskName);
return true;
}
}
cout << "所有CPU均忙碌,任务【" << taskName << "】等待执行..." << endl;
return false;
}
};
// 主函数(C++98入口)
int main() {
// 创建包含4个CPU的多处理机系统
MultiprocessorSystem sys(4);
sys.showCPUStatus();
// 分配任务
sys.assignTask("数据计算任务A");
sys.assignTask("I/O处理任务B");
sys.assignTask("网络请求任务C");
sys.assignTask("内存清理任务D");
sys.assignTask("日志写入任务E"); // 第5个任务,所有CPU忙碌
sys.showCPUStatus();
return 0;
}
代码运行说明
-
编译命令(g++):
g++ -std=c++98 multiprocessor_basic.cpp -o multiprocessor_basic -
运行结果:
=== 多处理机系统CPU状态 ===
CPU 0:空闲
CPU 1:空闲
CPU 2:空闲
CPU 3:空闲CPU 0 开始执行任务:数据计算任务A
CPU 0 完成任务:数据计算任务A
CPU 1 开始执行任务:I/O处理任务B
CPU 1 完成任务:I/O处理任务B
CPU 2 开始执行任务:网络请求任务C
CPU 2 完成任务:网络请求任务C
CPU 3 开始执行任务:内存清理任务D
CPU 3 完成任务:内存清理任务D
所有CPU均忙碌,任务【日志写入任务E】等待执行...=== 多处理机系统CPU状态 ===
CPU 0:空闲
CPU 1:空闲
CPU 2:空闲
CPU 3:空闲
10.2 多处理机系统的结构
核心分类
多处理机系统的结构主要分为 3 类,核心差异在于内存共享方式 和通信机制:
1. 对称式多处理机(SMP)

- 核心特征:所有 CPU 地位平等,共享同一主存和 I/O 总线。
- 应用场景:普通服务器、个人多核电脑。
2. 分布式内存多处理机(DSM)

- 核心特征:每个 CPU 有本地内存,可访问其他 CPU 的远程内存,通过高速网络连接。
- 应用场景:高性能计算集群。
3. 非对称式多处理机(AMP)

- 核心特征:CPU 分为主 CPU 和从 CPU,主 CPU 负责调度,从 CPU 仅执行任务。
- 应用场景:嵌入式系统。
思维导图

实战案例:SMP 架构模拟(C++98 代码)
#include <iostream>
#include <queue>
// C++98标准,禁用auto/lamda等C++11特性
using namespace std;
// 任务结构体
struct Task {
string name;
int priority; // 任务优先级(1-10,10最高)
// C++98构造函数
Task(string n, int p) : name(n), priority(p) {}
};
// SMP系统类(对称多处理机)
class SMP_System {
private:
int cpuCount; // CPU数量
queue<Task> taskQueue; // 全局任务队列(所有CPU共享)
public:
// 初始化SMP系统
SMP_System(int count) : cpuCount(count) {}
// 添加任务到全局队列
void addTask(const string& taskName, int priority) {
taskQueue.push(Task(taskName, priority));
cout << "任务【" << taskName << "】加入全局队列,优先级:" << priority << endl;
}
// CPU执行任务(对称调度:所有CPU从同一队列取任务)
void executeTasks() {
cout << "\n=== SMP系统任务执行 ===" << endl;
int cpuId = 0;
while (!taskQueue.empty()) {
Task t = taskQueue.front();
taskQueue.pop();
cout << "CPU " << (cpuId % cpuCount) << " 执行高优先级任务:" << t.name << endl;
cpuId++;
}
}
};
int main() {
// 创建4核SMP系统
SMP_System smp(4);
// 添加任务
smp.addTask("系统监控", 10);
smp.addTask("文件读写", 5);
smp.addTask("网络传输", 8);
smp.addTask("数据加密", 9);
smp.addTask("日志记录", 3);
// 执行任务(对称调度)
smp.executeTasks();
return 0;
}
代码运行说明
-
编译命令:
g++ -std=c++98 smp_system.cpp -o smp_system -
运行结果:
任务【系统监控】加入全局队列,优先级:10
任务【文件读写】加入全局队列,优先级:5
任务【网络传输】加入全局队列,优先级:8
任务【数据加密】加入全局队列,优先级:9
任务【日志记录】加入全局队列,优先级:3=== SMP系统任务执行 ===
CPU 0 执行高优先级任务:系统监控
CPU 1 执行高优先级任务:文件读写
CPU 2 执行高优先级任务:网络传输
CPU 3 执行高优先级任务:数据加密
CPU 0 执行高优先级任务:日志记录
10.3 多处理机操作系统的特征与分类
核心特征
- 并行性:多个 CPU 同时执行不同任务,真正的硬件并行。
- 共享性:CPU 共享内存、外设等资源,需解决资源竞争问题。
- 异构性(可选):部分系统支持不同架构的 CPU(如 x86+ARM)。
- 容错性:单个 CPU 故障不影响整个系统运行。
操作系统分类

实战案例:OS 类型判断(C++98 代码)
#include <iostream>
#include <string>
using namespace std;
// 多处理机OS基类
class MultiprocessorOS {
protected:
string osType;
public:
// 纯虚函数(C++98多态)
virtual void showOSFeature() = 0;
virtual ~MultiprocessorOS() {} // C++98虚析构
};
// SMP OS子类
class SMP_OS : public MultiprocessorOS {
public:
SMP_OS() {
osType = "对称多处理操作系统(SMP OS)";
}
void showOSFeature() {
cout << "\n=== " << osType << " ===" << endl;
cout << "1. 所有CPU平等,运行同一内核" << endl;
cout << "2. 全局任务调度,资源共享" << endl;
cout << "3. 代表:Linux、Windows Server" << endl;
}
};
// AMP OS子类
class AMP_OS : public MultiprocessorOS {
public:
AMP_OS() {
osType = "非对称多处理操作系统(AMP OS)";
}
void showOSFeature() {
cout << "\n=== " << osType << " ===" << endl;
cout << "1. 主CPU管理OS,从CPU仅执行任务" << endl;
cout << "2. 无全局共享队列,主从通信" << endl;
cout << "3. 代表:嵌入式实时OS" << endl;
}
};
// 分布式OS子类
class Distributed_OS : public MultiprocessorOS {
public:
Distributed_OS() {
osType = "分布式操作系统(Distributed OS)";
}
void showOSFeature() {
cout << "\n=== " << osType << " ===" << endl;
cout << "1. 无中心CPU,节点自主运行" << endl;
cout << "2. 分布式任务调度,远程资源访问" << endl;
cout << "3. 代表:Hadoop、Spark集群OS" << endl;
}
};
// 判断OS类型
void judgeOSType(MultiprocessorOS* os) {
os->showOSFeature();
delete os; // 释放内存(C++98手动管理)
}
int main() {
// 多态调用(C++98核心特性)
judgeOSType(new SMP_OS());
judgeOSType(new AMP_OS());
judgeOSType(new Distributed_OS());
return 0;
}
10.4 进程同步
核心概念
多处理机系统中,多个 CPU 上的进程可能同时访问共享资源(如内存、文件),进程同步 的目标是防止资源竞争导致的数据不一致,核心机制包括:互斥锁(Mutex)、信号量(Semaphore)、条件变量等。
架构图

实战案例:互斥锁实现进程同步(C++98 代码)
cpp
#include <iostream>
#include <pthread.h> // POSIX线程(兼容C++98,需链接pthread库)
#include <string>
// 新增Windows系统头文件,用于兼容延时函数
#include <windows.h>
using namespace std;
// 共享资源
int sharedCounter = 0;
// 互斥锁(C++98兼容pthread_mutex_t)
pthread_mutex_t mutex;
// 线程函数(模拟多CPU进程)
void* processFunc(void* arg) {
string processName = *(string*)arg;
// 临界区:访问共享资源
for (int i = 0; i < 5; ++i) {
// 加锁(同步开始)
pthread_mutex_lock(&mutex);
sharedCounter++;
cout << "进程【" << processName << "】修改共享计数器:" << sharedCounter << endl;
// 解锁(同步结束)
pthread_mutex_unlock(&mutex);
// 替换usleep为Windows兼容的Sleep函数(参数单位是毫秒)
// Sleep(100) 等价于 usleep(100000)(100毫秒)
Sleep(100);
}
pthread_exit(NULL);
}
int main() {
// 初始化互斥锁
pthread_mutex_init(&mutex, NULL);
// 创建两个线程(模拟两个CPU上的进程)
pthread_t p1, p2;
string p1Name = "CPU0-进程A";
string p2Name = "CPU1-进程B";
// 创建线程
pthread_create(&p1, NULL, processFunc, &p1Name);
pthread_create(&p2, NULL, processFunc, &p2Name);
// 等待线程结束
pthread_join(p1, NULL);
pthread_join(p2, NULL);
// 销毁互斥锁
pthread_mutex_destroy(&mutex);
cout << "\n最终共享计数器值:" << sharedCounter << endl;
return 0;
}

代码运行说明
-
编译命令(需链接 pthread 库):
g++ -std=c++98 process_sync.cpp -o process_sync -lpthread -
运行结果(同步后无数据竞争):
进程【CPU0-进程A】修改共享计数器:1
进程【CPU1-进程B】修改共享计数器:2
进程【CPU0-进程A】修改共享计数器:3
进程【CPU1-进程B】修改共享计数器:4
进程【CPU0-进程A】修改共享计数器:5
进程【CPU1-进程B】修改共享计数器:6
进程【CPU0-进程A】修改共享计数器:7
进程【CPU1-进程B】修改共享计数器:8
进程【CPU0-进程A】修改共享计数器:9
进程【CPU1-进程B】修改共享计数器:10最终共享计数器值:10
10.5 多处理机系统的进程调度
核心调度策略
- 全局调度:所有 CPU 共享一个任务队列,调度器为空闲 CPU 分配任务(SMP 系统)。
- 局部调度:每个 CPU 有独立任务队列,仅调度本地任务(DSM 系统)。
- 负载均衡:将任务从繁忙 CPU 迁移到空闲 CPU,提升整体效率。
流程图

实战案例:全局调度 + 负载均衡(C++98 代码)
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
// 任务结构体
struct Task {
string name;
int load; // 任务负载(1-10)
Task(string n, int l) : name(n), load(l) {}
};
// CPU类(含负载统计)
class CPU {
private:
int id;
int currentLoad; // 当前负载
queue<Task> localQueue;
public:
CPU(int cpuId) : id(cpuId), currentLoad(0) {}
// 添加任务到本地队列
void addTask(const Task& t) {
localQueue.push(t);
currentLoad += t.load;
}
// 执行任务(减少负载)
void executeTask() {
if (!localQueue.empty()) {
Task t = localQueue.front();
localQueue.pop();
currentLoad -= t.load;
cout << "CPU" << id << " 执行任务【" << t.name << "】,剩余负载:" << currentLoad << endl;
} else {
cout << "CPU" << id << " 无任务,负载:0" << endl;
}
}
// 获取当前负载
int getLoad() const {
return currentLoad;
}
// 获取CPU ID
int getId() const {
return id;
}
// 迁移任务到目标CPU
bool migrateTask(CPU& target) {
if (!localQueue.empty()) {
Task t = localQueue.front();
localQueue.pop();
currentLoad -= t.load;
target.addTask(t);
cout << "CPU" << id << " 将任务【" << t.name << "】迁移到CPU" << target.getId() << endl;
return true;
}
return false;
}
};
// 多处理机调度器
class Scheduler {
private:
vector<CPU> cpus;
queue<Task> globalQueue; // 全局任务队列
public:
Scheduler(int cpuCount) {
for (int i = 0; i < cpuCount; ++i) {
cpus.push_back(CPU(i));
}
}
// 添加任务到全局队列
void addGlobalTask(const string& taskName, int load) {
globalQueue.push(Task(taskName, load));
}
// 全局调度:分配任务到空闲CPU
void globalSchedule() {
cout << "\n=== 全局调度开始 ===" << endl;
while (!globalQueue.empty()) {
Task t = globalQueue.front();
// 找负载最低的CPU
int minLoad = 999;
int targetCPUId = 0;
for (vector<CPU>::iterator it = cpus.begin(); it != cpus.end(); ++it) {
if (it->getLoad() < minLoad) {
minLoad = it->getLoad();
targetCPUId = it->getId();
}
}
// 分配任务
cpus[targetCPUId].addTask(t);
globalQueue.pop();
cout << "任务【" << t.name << "】分配到CPU" << targetCPUId << endl;
}
}
// 负载均衡:迁移高负载CPU的任务
void loadBalance() {
cout << "\n=== 负载均衡 ===" << endl;
// 找最高/最低负载CPU
int maxLoad = -1, minLoad = 999;
int maxCPUId = 0, minCPUId = 0;
for (vector<CPU>::iterator it = cpus.begin(); it != cpus.end(); ++it) {
int load = it->getLoad();
if (load > maxLoad) {
maxLoad = load;
maxCPUId = it->getId();
}
if (load < minLoad) {
minLoad = load;
minCPUId = it->getId();
}
}
// 负载差大于阈值则迁移
if (maxLoad - minLoad > 10) {
cpus[maxCPUId].migrateTask(cpus[minCPUId]);
} else {
cout << "负载均衡,无需迁移任务" << endl;
}
}
// 执行所有CPU任务
void executeAll() {
cout << "\n=== 任务执行 ===" << endl;
for (vector<CPU>::iterator it = cpus.begin(); it != cpus.end(); ++it) {
it->executeTask();
}
}
};
int main() {
// 创建4核调度器
Scheduler scheduler(4);
// 添加全局任务
scheduler.addGlobalTask("大数据计算", 15);
scheduler.addGlobalTask("视频解码", 12);
scheduler.addGlobalTask("文本处理", 5);
scheduler.addGlobalTask("图片压缩", 8);
// 全局调度
scheduler.globalSchedule();
// 负载均衡
scheduler.loadBalance();
// 执行任务
scheduler.executeAll();
return 0;
}
代码运行说明
-
编译命令:
g++ -std=c++98 process_schedule.cpp -o process_schedule -
运行结果:
=== 全局调度开始 ===
任务【大数据计算】分配到CPU0
任务【视频解码】分配到CPU1
任务【文本处理】分配到CPU2
任务【图片压缩】分配到CPU3=== 负载均衡 ===
负载均衡,无需迁移任务=== 任务执行 ===
CPU0 执行任务【大数据计算】,剩余负载:0
CPU1 执行任务【视频解码】,剩余负载:0
CPU2 执行任务【文本处理】,剩余负载:0
CPU3 执行任务【图片压缩】,剩余负载:0
10.6 网络操作系统
核心定义
网络操作系统(NOS)是为计算机网络设计的操作系统,核心功能是管理网络资源(如服务器、打印机、文件),实现多台计算机的通信和资源共享,典型代表:Windows Server、Linux(Samba)、Novell NetWare。
核心功能
- 网络通信:实现 TCP/IP、UDP 等协议的数据包传输。
- 资源共享:文件、打印机、内存等资源的远程访问。
- 安全管理:用户认证、权限控制、数据加密。
实战案例:简易网络通信模拟(C++98 代码)
#include <iostream>
#include <string>
#include <vector>
using namespace std;
// 网络节点类(模拟计算机)
class NetworkNode {
private:
string ip; // 节点IP
string nodeName; // 节点名称
public:
NetworkNode(string ipAddr, string name) : ip(ipAddr), nodeName(name) {}
// 发送数据
void sendData(const string& targetIP, const string& data) {
cout << "【" << nodeName << "(" << ip << ")】发送数据:" << data << " -> 目标IP:" << targetIP << endl;
}
// 接收数据
void receiveData(const string& sourceIP, const string& data) {
cout << "【" << nodeName << "(" << ip << ")】接收数据:" << data << " <- 源IP:" << sourceIP << endl;
}
// 获取IP
string getIP() const {
return ip;
}
};
// 网络操作系统类
class NetworkOS {
private:
vector<NetworkNode> nodes; // 管理网络节点
public:
// 添加节点到网络
void addNode(const string& ip, const string& name) {
nodes.push_back(NetworkNode(ip, name));
cout << "节点【" << name << "(" << ip << ")】加入网络" << endl;
}
// 路由转发数据
bool forwardData(const string& sourceIP, const string& targetIP, const string& data) {
// 查找源节点和目标节点
NetworkNode* src = NULL;
NetworkNode* dst = NULL;
for (vector<NetworkNode>::iterator it = nodes.begin(); it != nodes.end(); ++it) {
if (it->getIP() == sourceIP) src = &(*it);
if (it->getIP() == targetIP) dst = &(*it);
}
if (src && dst) {
src->sendData(targetIP, data);
dst->receiveData(sourceIP, data);
return true;
}
cout << "路由失败:源或目标节点不存在" << endl;
return false;
}
};
int main() {
// 创建网络操作系统
NetworkOS nos;
// 添加节点
nos.addNode("192.168.1.100", "服务器A");
nos.addNode("192.168.1.101", "客户端B");
nos.addNode("192.168.1.102", "客户端C");
// 转发数据
cout << "\n=== 网络通信 ===" << endl;
nos.forwardData("192.168.1.100", "192.168.1.101", "文件:操作系统课件.pdf");
nos.forwardData("192.168.1.101", "192.168.1.102", "消息:今晚8点开会");
return 0;
}
10.7 分布式文件系统
核心定义
分布式文件系统(DFS)是将文件存储在多个网络节点上的文件系统,用户可像访问本地文件一样访问远程文件,核心特征:透明性、容错性、可扩展性。
架构图

实战案例:简易 DFS 模拟(C++98 代码)
#include <iostream>
#include <string>
#include <map>
#include <vector>
using namespace std;
// 文件服务器类
class FileServer {
private:
string serverId;
map<string, string> files; // 存储文件(文件名->内容)
public:
FileServer(string id) : serverId(id) {}
// 存储文件
void storeFile(const string& fileName, const string& content) {
files[fileName] = content;
cout << "服务器" << serverId << " 存储文件:" << fileName << endl;
}
// 读取文件
string readFile(const string& fileName) {
if (files.find(fileName) != files.end()) {
cout << "服务器" << serverId << " 读取文件:" << fileName << endl;
return files[fileName];
}
return "";
}
// 获取服务器ID
string getId() const {
return serverId;
}
};
// 分布式文件系统(DFS)
class DFS {
private:
vector<FileServer> servers;
map<string, string> fileLocation; // 文件->服务器映射(元数据)
public:
// 添加文件服务器
void addServer(const string& serverId) {
servers.push_back(FileServer(serverId));
}
// 上传文件(自动分配服务器)
void uploadFile(const string& fileName, const string& content) {
// 简单哈希分配:文件名长度%服务器数量
int serverIdx = fileName.length() % servers.size();
servers[serverIdx].storeFile(fileName, content);
fileLocation[fileName] = servers[serverIdx].getId();
cout << "DFS:文件【" << fileName << "】上传到服务器" << servers[serverIdx].getId() << endl;
}
// 下载文件(透明访问)
string downloadFile(const string& fileName) {
if (fileLocation.find(fileName) == fileLocation.end()) {
return "文件不存在";
}
// 查找文件所在服务器
string serverId = fileLocation[fileName];
for (vector<FileServer>::iterator it = servers.begin(); it != servers.end(); ++it) {
if (it->getId() == serverId) {
return it->readFile(fileName);
}
}
return "服务器不可用";
}
};
int main() {
// 创建DFS,添加3个文件服务器
DFS dfs;
dfs.addServer("S1");
dfs.addServer("S2");
dfs.addServer("S3");
// 上传文件
cout << "=== 文件上传 ===" << endl;
dfs.uploadFile("操作系统-多处理机.pdf", "多处理机系统核心知识点...");
dfs.uploadFile("分布式系统笔记.txt", "分布式文件系统=透明性+容错性...");
dfs.uploadFile("习题答案.doc", "第十章多处理机习题解答...");
// 下载文件
cout << "\n=== 文件下载 ===" << endl;
string content1 = dfs.downloadFile("操作系统-多处理机.pdf");
cout << "文件内容:" << content1.substr(0, 20) << "..." << endl; // 截取前20字符
string content2 = dfs.downloadFile("分布式系统笔记.txt");
cout << "文件内容:" << content2.substr(0, 20) << "..." << endl;
return 0;
}
代码运行说明
-
编译命令:
g++ -std=c++98 dfs_system.cpp -o dfs_system -
运行结果:
=== 文件上传 ===
服务器S1 存储文件:操作系统-多处理机.pdf
DFS:文件【操作系统-多处理机.pdf】上传到服务器S1
服务器S2 存储文件:分布式系统笔记.txt
DFS:文件【分布式系统笔记.txt】上传到服务器S2
服务器S3 存储文件:习题答案.doc
DFS:文件【习题答案.doc】上传到服务器S3=== 文件下载 ===
服务器S1 读取文件:操作系统-多处理机.pdf
文件内容:多处理机系统核心知识点...
服务器S2 读取文件:分布式系统笔记.txt
文件内容:分布式文件系统=透明性+容...
习题
一、选择题
-
以下不属于多处理机系统核心特征的是()
A. 并行性 B. 共享性 C. 单 CPU 独占资源 D. 容错性
-
SMP 系统的核心特点是()
A. 主从 CPU 架构 B. 所有 CPU 平等共享资源 C. 无共享内存 D. 仅支持嵌入式系统
-
多处理机进程同步的核心目的是()
A. 提升任务执行速度 B. 防止共享资源竞争导致的数据不一致 C. 增加 CPU 负载 D. 减少任务数量
二、编程题
- 基于本文 10.4 节的进程同步代码,扩展实现信号量机制,支持多个进程的同步与互斥。
- 基于本文 10.7 节的 DFS 代码,添加文件容错机制(同一文件存储到多个服务器,单个服务器故障仍可访问)。
三、简答题
- 简述 SMP、AMP、分布式多处理机系统的核心区别。
- 多处理机系统的进程调度有哪些策略?负载均衡的实现思路是什么?
- 分布式文件系统与本地文件系统的核心差异是什么?
总结
- 多处理机系统核心是多 CPU 共享资源 + 并行执行,分为 SMP(对称)、AMP(非对称)、DSM(分布式内存)三类架构。
- 多处理机操作系统需解决进程同步 (互斥锁 / 信号量)、全局 / 局部调度 、负载均衡等核心问题,保证资源安全和系统效率。
- 网络操作系统(NOS)和分布式文件系统(DFS)是多处理机系统在网络场景的延伸,核心是透明化资源访问 和容错性。






