[{"data":1,"prerenderedAt":1339},["ShallowReactive",2],{"note:cs\u002Fos\u002Ftestbank\u002Fchap4":3,"site-search-catalogue":1338},{"id":4,"title":5,"body":6,"description":1324,"extension":1330,"meta":1331,"navigation":1333,"path":1334,"seo":1335,"stem":1336,"__hash__":1337},"notes\u002Fsource\u002Fcs\u002Fos\u002Ftestbank\u002Fchap4.md","Chap. 4",{"type":7,"value":8,"toc":1323},"minimark",[9,14,19,26,55,60,83,88,106,111,137,142,164,169,187,192,210,215,237,242,260,265,291,296,314,319,337,342,373,378,400,405,427,430,434,440,467,473,492,498,521,527,557,563,582,588,614,620,639,645,668,674,705,711,733,739,769,775,805,811,834,840,863,869,902,904,908,913,936,941,960,965,989,994,1017,1022,1045,1050,1069,1074,1097,1102,1121,1126,1149,1154,1177,1182,1204,1209,1232,1237,1267,1272,1295,1300],[10,11,13],"h1",{"id":12},"chapter-4-threads-smp-and-microkernels","Chapter 4 - Threads, SMP, and Microkernels",[15,16,18],"h2",{"id":17},"一-true-false-questions-判断题","一、 True \u002F False Questions (判断题)",[20,21,22],"p",{},[23,24,25],"strong",{},"1. The basic unit of dispatching in an operating system is usually referred to as a thread or lightweight process.",[27,28,29,36,45],"ul",{},[30,31,32,35],"li",{},[23,33,34],{},"中文翻译","：操作系统中的基本调度单位通常被称为线程（thread）或轻量级进程（lightweight process）。",[30,37,38,41,42],{},[23,39,40],{},"答案","：",[23,43,44],{},"True (正确)",[30,46,47,50,51,54],{},[23,48,49],{},"知识点讲解","：在现代操作系统中，**进程（Process）",[23,52,53],{},"是资源分配和保护的基本单位，而","线程（Thread）**或轻量级进程是 CPU 调度和执行的基本单位。一个进程可以包含一个或多个线程。",[20,56,57],{},[23,58,59],{},"2. An example of a system that implements a single process with multiple threads is MS-DOS.",[27,61,62,67,74],{},[30,63,64,66],{},[23,65,34],{},"：实现单进程多线程的系统的一个例子是 MS-DOS。",[30,68,69,41,71],{},[23,70,40],{},[23,72,73],{},"False (错误)",[30,75,76,78,79,82],{},[23,77,49],{},"：MS-DOS 是典型的",[23,80,81],{},"单进程单线程","（Single process, single thread）操作系统。**Java 运行时环境（JVM）**才是单进程多线程（Single process, multiple threads）的典型代表。",[20,84,85],{},[23,86,87],{},"3. In a multithreaded environment, a process is defined as the unit of resource allocation and a unit of protection.",[27,89,90,95,101],{},[30,91,92,94],{},[23,93,34],{},"：在多线程环境中，进程被定义为资源分配单位和保护单位。",[30,96,97,41,99],{},[23,98,40],{},[23,100,44],{},[30,102,103,105],{},[23,104,49],{},"：多线程模型将进程的两个核心属性分开了。进程依然拥有独立的虚拟地址空间、文件句柄和其他系统资源，并负责资源隔离与保护；而线程只拥有执行所必需的最小状态（如程序计数器、栈、寄存器上下文）。",[20,107,108],{},[23,109,110],{},"4. The concept of thread synchronization is required in multithreaded systems because threads of a single process share the process's process control block (PCB).",[27,112,113,118,124],{},[30,114,115,117],{},[23,116,34],{},"：多线程系统需要线程同步的概念，因为单个进程的线程共享该进程的进程控制块 (PCB)。",[30,119,120,41,122],{},[23,121,40],{},[23,123,73],{},[30,125,126,128,129,132,133,136],{},[23,127,49],{},"：线程需要同步的根本原因",[23,130,131],{},"不是","共享 PCB，而是因为它们",[23,134,135],{},"共享该进程的内存地址空间（Address Space）和全局变量等资源","。并发访问共享内存中的数据会导致竞争条件，因此需要互斥和同步机制。每个线程实际上有自己的线程控制块（TCB）。",[20,138,139],{},[23,140,141],{},"5. In a pure User-Level Thread (ULT) facility, all of the work of thread management is done by the application, but the kernel is aware of the existence of threads.",[27,143,144,149,155],{},[30,145,146,148],{},[23,147,34],{},"：在纯用户级线程 (ULT) 机制中，所有线程管理工作都由应用程序完成，但内核知道线程的存在。",[30,150,151,41,153],{},[23,152,40],{},[23,154,73],{},[30,156,157,159,160,163],{},[23,158,49],{},"：在纯用户级线程 (ULT) 模型中，线程管理完全由用户空间的线程库（Thread Library）负责，",[23,161,162],{},"内核对 ULT 一无所知（The kernel is unaware of the existence of threads）","。内核依然把该应用程序当成一个单线程的普通进程进行调度。",[20,165,166],{},[23,167,168],{},"6. In the field of distributed operating system design, the One-to-Many (Thread-to-Process) relationship is particularly interesting because it involves the concept of thread migration.",[27,170,171,176,182],{},[30,172,173,175],{},[23,174,34],{},"：在分布式操作系统设计领域，一对多（线程对进程）关系特别有趣，因为它涉及线程迁移（thread migration）的概念。",[30,177,178,41,180],{},[23,179,40],{},[23,181,44],{},[30,183,184,186],{},[23,185,49],{},"：在“一对多”模型（如 Ra 操作系统）中，一个逻辑线程可以跨越多个进程甚至多台机器的边界。这种机制允许一个线程在不同节点的地址空间中移动执行，这就是线程迁移。",[20,188,189],{},[23,190,191],{},"7. One disadvantage to the master\u002Fslave shared-memory multiprocessor architecture is that the failure of the master brings down the whole system.",[27,193,194,199,205],{},[30,195,196,198],{},[23,197,34],{},"：主\u002F从（master\u002Fslave）共享内存多处理器架构的一个缺点是，主处理器的故障会导致整个系统崩溃。",[30,200,201,41,203],{},[23,202,40],{},[23,204,44],{},[30,206,207,209],{},[23,208,49],{},"：在主从架构中，主处理器（Master）负责所有的内核功能、调度和 I\u002FO 管理，从处理器（Slaves）仅执行用户程序。如果 Master 宕机，整个系统将失去核心管理能力，从而全面崩溃，存在单点故障（Single Point of Failure）。",[20,211,212],{},[23,213,214],{},"8. In a symmetric multiprocessing (SMP) system, each processor has access only to a private main memory area.",[27,216,217,222,228],{},[30,218,219,221],{},[23,220,34],{},"：在对称多处理 (SMP) 系统中，每个处理器只能访问私有的主存区域。",[30,223,224,41,226],{},[23,225,40],{},[23,227,73],{},[30,229,230,232,233,236],{},[23,231,49],{},"：SMP 架构的核心特征之一就是",[23,234,235],{},"共享主存（Shared Memory）","。所有的处理器不仅有均等的地位，还可以通过同一个系统总线或互连网络访问同一个全局主存空间（以及共享的 I\u002FO 设备）。",[20,238,239],{},[23,240,241],{},"9. An SMP O\u002FS manages processor and other resources so that the user may view the system in the same fashion as a multiprogramming uniprocessor system.",[27,243,244,249,255],{},[30,245,246,248],{},[23,247,34],{},"：SMP 操作系统管理处理器和其他资源，以便用户可以像查看多道程序单处理器系统一样查看该系统。",[30,250,251,41,253],{},[23,252,40],{},[23,254,44],{},[30,256,257,259],{},[23,258,49],{},"：SMP 操作系统必须对用户提供透明性。底层的多处理器对用户程序是隐藏的，程序员和用户感觉就像在使用一个速度更快的单处理器系统，不需要修改应用程序代码。",[20,261,262],{},[23,263,264],{},"10. The primary advantage of the basic microkernel design over layered kernel designs involves increased performance.",[27,266,267,272,278],{},[30,268,269,271],{},[23,270,34],{},"：与分层内核设计相比，基本微内核设计的主要优势在于提高了性能。",[30,273,274,41,276],{},[23,275,40],{},[23,277,73],{},[30,279,280,282,283,286,287,290],{},[23,281,49],{},"：微内核（Microkernel）的",[23,284,285],{},"主要缺点恰恰是性能开销大","。由于大多数系统服务被移到了用户空间，服务请求需要通过内核的进程间通信（IPC，通常是消息传递）来进行，导致频繁的上下文切换和模式切换。微内核的优势在于",[23,288,289],{},"扩展性、灵活性、可移植性和可靠性","，而非性能。",[20,292,293],{},[23,294,295],{},"11. The philosophy underlying the microkernel is that only absolutely essential core operating system functions should be in the kernel.",[27,297,298,303,309],{},[30,299,300,302],{},[23,301,34],{},"：微内核的基础哲学是，内核中只应包含绝对必要的操作系统核心功能。",[30,304,305,41,307],{},[23,306,40],{},[23,308,44],{},[30,310,311,313],{},[23,312,49],{},"：微内核设计将文件系统、设备驱动、网络协议栈等功能移出内核空间，内核仅保留最基本的功能，如地址空间管理、进程间通信（IPC）和基本的调度。",[20,315,316],{},[23,317,318],{},"12. The basic form of communication between processes or threads in a microkernel O\u002FS is messages.",[27,320,321,326,332],{},[30,322,323,325],{},[23,324,34],{},"：在微内核操作系统中，进程或线程之间基本的通信形式是消息（messages）。",[30,327,328,41,330],{},[23,329,40],{},[23,331,44],{},[30,333,334,336],{},[23,335,49],{},"：在微内核中，由于各个系统服务作为独立的用户级服务器运行，它们之间以及它们与客户端程序之间的通信必须依赖于底层的消息传递机制（Message Passing IPC）。",[20,338,339],{},[23,340,341],{},"13. Linux makes no distinction between a process and a thread.",[27,343,344,349,355],{},[30,345,346,348],{},[23,347,34],{},"：Linux 对进程和线程不作区分。",[30,350,351,41,353],{},[23,352,40],{},[23,354,44],{},[30,356,357,359,360,363,364,368,369,372],{},[23,358,49],{},"：在 Linux 内核层面，没有传统意义上独立的“线程”数据结构。它将进程和线程统称为",[23,361,362],{},"任务（Task）","，都使用 ",[365,366,367],"code",{},"task_struct"," 结构来表示。线程只是被视作与其他任务共享某些资源（如虚拟内存、打开的文件）的进程（通常通过 ",[365,370,371],{},"clone()"," 系统调用创建）。",[20,374,375],{},[23,376,377],{},"14. Windows 2000 is an object-oriented O\u002FS, but only processes (not threads) are implemented as objects in the WIN2K O\u002FS.",[27,379,380,385,391],{},[30,381,382,384],{},[23,383,34],{},"：Windows 2000 是一个面向对象的操作系统，但在 WIN2K OS 中只有进程（而非线程）被实现为对象。",[30,386,387,41,389],{},[23,388,40],{},[23,390,73],{},[30,392,393,395,396,399],{},[23,394,49],{},"：Windows (从 NT\u002F2000 起) 高度依赖对象架构。不仅进程是对象（Process Object），",[23,397,398],{},"线程本身也是被内核管理的对象（Thread Object）","。",[20,401,402],{},[23,403,404],{},"15. In the Solaris O\u002FS, a User-Level Thread (ULT) in the active state is assigned to a Light-Weight Process (LWP) and executes while the underlying kernel thread executes.",[27,406,407,412,418],{},[30,408,409,411],{},[23,410,34],{},"：在 Solaris 操作系统中，处于活动状态的用户级线程 (ULT) 被分配给轻量级进程 (LWP)，并在底层内核线程执行时执行。",[30,413,414,41,416],{},[23,415,40],{},[23,417,44],{},[30,419,420,422,423,426],{},[23,421,49],{},"：Solaris 采用经典的",[23,424,425],{},"多对多（M:N）模型","。应用程序创建许多 ULT，而操作系统维护一组 LWP（每个 LWP 映射到一个真正的 Kernel Thread）。活跃的 ULT 会被复用绑定（绑定执行）到某个 LWP 上从而获得 CPU 时间。",[428,429],"hr",{},[15,431,433],{"id":432},"二-multiple-choice-questions-单选题","二、 Multiple Choice Questions (单选题)",[20,435,436,439],{},[23,437,438],{},"1. The concept of a process in an operating system embodies two primary characteristics, one of which is:","\na. Multithreading\nb. Resource ownership\nc. Symmetric multiprocessing\nd. None of the above",[27,441,442,447,454],{},[30,443,444,446],{},[23,445,34],{},"：操作系统中的进程概念体现了两个主要特征，其中之一是：\na. 多线程\nb. 资源所有权 (Resource ownership)\nc. 对称多处理\nd. 以上都不是",[30,448,449,41,451],{},[23,450,40],{},[23,452,453],{},"b. Resource ownership",[30,455,456,458,459,462,463,466],{},[23,457,49],{},"：传统的进程概念包含两个核心独立特征：一是",[23,460,461],{},"资源所有权 (Resource ownership)","，二是",[23,464,465],{},"调度\u002F执行 (Scheduling\u002FExecution)","。多线程技术就是把这两者分离，进程拥有资源，线程负责执行。",[20,468,469,472],{},[23,470,471],{},"2. An example of a system that implements a single process with multiple threads is:","\na. WIN 2000\nb. Solaris\nc. Java\nd. All of the above",[27,474,475,480,487],{},[30,476,477,479],{},[23,478,34],{},"：实现单进程多线程的系统的一个例子是：\na. Windows 2000 (支持多进程多线程)\nb. Solaris (支持多进程多线程)\nc. Java (运行时环境是单进程多线程)\nd. 以上都是",[30,481,482,41,484],{},[23,483,40],{},[23,485,486],{},"c. Java",[30,488,489,491],{},[23,490,49],{},"：早期的系统分类中，MS-DOS 是 1:1（单进程单线程）；传统的 UNIX 是 N:1（多进程单线程）；Java 运行环境（JVM 本身运行为一个进程）内部支持多个执行流，体现了 1:N（单进程多线程）的概念；现代 OS (Win\u002FSolaris\u002FLinux) 则是 N:M（多进程多线程）。",[20,493,494,497],{},[23,495,496],{},"3. Which of the following is true regarding the relationship between processes and threads:","\na. It takes far less time to create a new thread in an existing process than to create a new process\nb. It takes less time to terminate a process than a thread\nc. It takes less time to switch between two different processes than to switch between two threads within the same process\nd. All of the above",[27,499,500,505,512],{},[30,501,502,504],{},[23,503,34],{},"：关于进程和线程之间的关系，以下哪项是正确的：\na. 在现有进程中创建新线程比创建新进程花费的时间要少得多。\nb. 终止进程比终止线程花费的时间少。（错误，线程轻量）\nc. 在两个不同进程之间切换的时间比在同一进程的两个线程之间切换的时间少。（错误，进程上下文切换重于线程）\nd. 以上都是",[30,506,507,41,509],{},[23,508,40],{},[23,510,511],{},"a. It takes far less time to create a new thread in an existing process than to create a new process",[30,513,514,516,517,520],{},[23,515,49],{},"：线程是轻量级的。由于线程共享了地址空间和系统资源，创建线程无需复制页表、分配大块内存等，因此创建、终止、切换线程的开销都远",[23,518,519],{},"低于","进程。",[20,522,523,526],{},[23,524,525],{},"4. The basic thread operation related to the change in thread state that occurs when a thread needs to wait for an event is referred to as the:","\na. Unblock operation\nb. Spawn operation\nc. Block operation\nd. None of the above",[27,528,529,534,541],{},[30,530,531,533],{},[23,532,34],{},"：当线程需要等待某个事件时发生的状态更改相关的基本线程操作被称为：",[30,535,536,41,538],{},[23,537,40],{},[23,539,540],{},"c. Block operation",[30,542,543,545,546,549,550,553,554,399],{},[23,544,49],{},"：线程与进程类似，有基本的生命周期操作。等待事件（如 I\u002FO 或锁）时，会执行 ",[23,547,548],{},"阻塞 (Block)"," 操作；当事件发生时，会执行 ",[23,551,552],{},"解除阻塞 (Unblock)"," 操作；派生新线程称为 ",[23,555,556],{},"产生 (Spawn)",[20,558,559,562],{},[23,560,561],{},"5. One of the disadvantages of User-Level Threads (ULTs) compared to Kernel-Level Threads (KLTs) is:","\na. Scheduling is application specific\nb. When a ULT executes a system call, all threads in the process are blocked\nc. Thread switching does not require kernel mode privileges\nd. All of the above",[27,564,565,570,577],{},[30,566,567,569],{},[23,568,34],{},"：与内核级线程 (KLT) 相比，用户级线程 (ULT) 的缺点之一是：\na. 调度是特定于应用程序的（这是优点）\nb. 当一个 ULT 执行系统调用时，进程中的所有线程都会被阻塞（致命缺点）\nc. 线程切换不需要内核模式权限（这是优点）\nd. 以上都是",[30,571,572,41,574],{},[23,573,40],{},[23,575,576],{},"b. When a ULT executes a system call, all threads in the process are blocked",[30,578,579,581],{},[23,580,49],{},"：ULT 对内核不可见，内核只知道包含这些线程的整个进程。因此，如果进程中的某一个 ULT 发起了阻塞式的系统调用（如读取文件），内核就会阻塞整个进程，导致进程内的其他 ULT 全部停滞，无法利用多处理器的并发优势。",[20,583,584,587],{},[23,585,586],{},"6. In the Linux O\u002FS, multiple threads may be created and executed within a single process. This is an example of the following Thread-to-Process relationship:","\na. 1:1\nb. 1:M\nc. M:N\nd. None of the above",[27,589,590,595,602],{},[30,591,592,594],{},[23,593,34],{},"：在 Linux 操作系统中，可以在单个进程内创建和执行多个线程。这是以下哪种线程与进程关系的示例：",[30,596,597,41,599],{},[23,598,40],{},[23,600,601],{},"a. 1:1",[30,603,604,606,607,610,611,613],{},[23,605,49],{},"：在 Linux 的设计中（通过 NPTL，Native POSIX Thread Library），实现了 ",[23,608,609],{},"1:1（One-to-One）模型","。每一个用户空间的线程都直接对应一个内核空间的 ",[365,612,367],{},"（即内核可调度的独立实体）。",[20,615,616,619],{},[23,617,618],{},"7. The computer system category where a single processor executes a single instruction stream to operate on data stored in a single memory is called:","\na. Single Instruction Single Data (SISD) stream\nb. Single Instruction Multiple Data (SIMD) stream\nc. Multiple Instruction Single Data (MISD) stream\nd. None of the above",[27,621,622,627,634],{},[30,623,624,626],{},[23,625,34],{},"：单处理器执行单条指令流来操作存储在单一内存中的数据的计算机系统类别被称为：",[30,628,629,41,631],{},[23,630,40],{},[23,632,633],{},"a. Single Instruction Single Data (SISD) stream",[30,635,636,638],{},[23,637,49],{},"：这是弗林分类法（Flynn's Taxonomy）中最传统的单机架构：单指令流、单数据流 (SISD)。常见的桌面单核 CPU 即属于此类。",[20,640,641,644],{},[23,642,643],{},"8. In a SMP system, each processor maintains a local cache and must alert all other processors that a change to cache update has taken place. This is referred to as the:","\na. Interconnection mechanism problem\nb. Synchronization mechanism problem\nc. Cache coherency problem\nd. None of the above",[27,646,647,652,659],{},[30,648,649,651],{},[23,650,34],{},"：在 SMP 系统中，每个处理器维护一个本地缓存，并且必须向所有其他处理器发出警报，表明缓存更新已发生更改。这被称为：",[30,653,654,41,656],{},[23,655,40],{},[23,657,658],{},"c. Cache coherency problem",[30,660,661,663,664,667],{},[23,662,49],{},"：这是多处理器系统中经典的",[23,665,666],{},"缓存一致性问题（Cache Coherency Problem）","。由于内存数据可能缓存在多个处理器的私有 L1\u002FL2 缓存中，如果一个处理器修改了数据，必须通过总线嗅探（Snooping）或目录协议等机制让其他处理器的缓存失效或更新，以防止读取脏数据。",[20,669,670,673],{},[23,671,672],{},"9. Key issues involved in the design of multiprocessor operating systems include:","\na. Scheduling\nb. Synchronization\nc. Reliability and fault tolerance\nd. All of the above",[27,675,676,681,688],{},[30,677,678,680],{},[23,679,34],{},"：多处理器操作系统设计中涉及的关键问题包括：",[30,682,683,41,685],{},[23,684,40],{},[23,686,687],{},"d. All of the above",[30,689,690,692,693,696,697,700,701,704],{},[23,691,49],{},"：SMP 操作系统要比单核复杂得多。必须处理好进程\u002F线程分配到哪个 CPU (",[23,694,695],{},"Scheduling",")、并发访问内核资源的锁冲突 (",[23,698,699],{},"Synchronization",") 以及某个 CPU 宕机不影响整体系统的容错机制 (",[23,702,703],{},"Reliability and fault tolerance",")。",[20,706,707,710],{},[23,708,709],{},"10. Early operating systems that were designed with little concern about structure are typically referred to as:","\na. Monolithic operating systems\nb. Layered operating systems\nc. Kernel operating systems\nd. All of the above",[27,712,713,718,725],{},[30,714,715,717],{},[23,716,34],{},"：早期设计时很少考虑结构的操作系统通常被称为：",[30,719,720,41,722],{},[23,721,40],{},[23,723,724],{},"a. Monolithic operating systems",[30,726,727,729,730,399],{},[23,728,49],{},"：早期的操作系统功能混杂在一起，全部代码运行在内核态，缺乏清晰的模块化边界，这种庞大且无明确结构的系统被称为",[23,731,732],{},"单体内核（Monolithic kernel \u002F OS）",[20,734,735,738],{},[23,736,737],{},"11. A benefit of the microkernel organization is:","\na. Extensibility\nb. Portability\nc. Flexibility\nd. All of the above",[27,740,741,746,752],{},[30,742,743,745],{},[23,744,34],{},"：微内核组织的优点是：",[30,747,748,41,750],{},[23,749,40],{},[23,751,687],{},[30,753,754,756,757,760,761,764,765,768],{},[23,755,49],{},"：微内核的主要优点：",[23,758,759],{},"可扩展性 (Extensibility)"," 方便增加新功能（只需新增用户态服务器）；",[23,762,763],{},"可移植性 (Portability)"," 因为硬件相关代码最小化；",[23,766,767],{},"灵活性 (Flexibility)"," 允许根据需求裁剪系统组件。",[20,770,771,774],{},[23,772,773],{},"12. In low-level microkernel memory management, an example of an operation that can support external paging and virtual memory management is the:","\na. Grant operation\nb. Map operation\nc. Flush operation\nd. All of the above",[27,776,777,782,788],{},[30,778,779,781],{},[23,780,34],{},"：在底层的微内核内存管理中，能够支持外部调页和虚拟内存管理的内存操作例子是：",[30,783,784,41,786],{},[23,785,40],{},[23,787,687],{},[30,789,790,792,793,796,797,800,801,804],{},[23,791,49],{},"：以著名的 Mach 微内核为例，它为了让用户空间程序接管复杂的虚拟内存管理，提供了三条基本的底层原语：",[23,794,795],{},"Grant (授权)"," 允许传递页框使用权；",[23,798,799],{},"Map (映射)"," 允许共享页框；",[23,802,803],{},"Flush (刷新)"," 允许回收页框。",[20,806,807,810],{},[23,808,809],{},"13. In a W2K system, the state that a thread enters when it has been unblocked and the resource for which it has been blocked is not yet available is called the:","\na. Transition state\nb. Waiting state\nc. Standby state\nd. None of the above",[27,812,813,818,825],{},[30,814,815,817],{},[23,816,34],{},"：在 Windows 2000 系统中，当线程被解除阻塞但其所需资源（通常指内存）尚不可用时，它进入的状态被称为：",[30,819,820,41,822],{},[23,821,40],{},[23,823,824],{},"a. Transition state",[30,826,827,829,830,833],{},[23,828,49],{},"：在 Windows 线程状态机中，当线程从阻塞（Wait）中被唤醒准备执行，但它的内核栈被换出到磁盘（Page Out）还没载入物理内存时，它会处于一种短暂的 ",[23,831,832],{},"转换状态 (Transition)","，待内存加载完毕后才转入就绪态 (Ready)。",[20,835,836,839],{},[23,837,838],{},"14. In a Solaris system, a User-Level Thread (ULT) that enters the active state is assigned to a:","\na. Kernel thread\nb. Heavy-Weight Process (HWP)\nc. Light-Weight Process (LWP)\nd. None of the above",[27,841,842,847,854],{},[30,843,844,846],{},[23,845,34],{},"：在 Solaris 系统中，进入活动状态的用户级线程 (ULT) 被分配给：",[30,848,849,41,851],{},[23,850,40],{},[23,852,853],{},"c. Light-Weight Process (LWP)",[30,855,856,858,859,862],{},[23,857,49],{},"：在 Solaris M:N 模型中，ULT 不直接与底层 Kernel Thread 交互，它们被复用和调度到中间层的 ",[23,860,861],{},"轻量级进程 (LWP)"," 上执行。",[20,864,865,868],{},[23,866,867],{},"15. In a Linux system, when a new process is cloned, the two processes share the same:","\na. Process identifier\nb. Virtual memory\nc. task_struct data structure\nd. All of the above",[27,870,871,876,883],{},[30,872,873,875],{},[23,874,34],{},"：在 Linux 系统中，当使用 clone 克隆一个新进程时，这两个进程共享相同的：",[30,877,878,41,880],{},[23,879,40],{},[23,881,882],{},"b. Virtual memory",[30,884,885,887,888,890,891,894,895,898,899,901],{},[23,886,49],{},"：Linux 使用 ",[365,889,371],{}," 系统调用来创建线程。通过传递特定标志（如 ",[365,892,893],{},"CLONE_VM","），新老任务（Task）可以",[23,896,897],{},"共享同一个虚拟内存空间 (Virtual memory)","。但它们依然有各自的 ",[365,900,367],{}," 结构和内部唯一的进程标识符 (PID\u002FTID)。",[428,903],{},[15,905,907],{"id":906},"三-fill-in-the-blank-questions-填空题","三、 Fill-In-The-Blank Questions (填空题)",[20,909,910],{},[23,911,912],{},"1. In an operating system, the unit of dispatching is usually referred to as a ________ while the unit of resource ownership is usually referred to as a process or task.",[27,914,915,920,927],{},[30,916,917,919],{},[23,918,34],{},"：在操作系统中，调度的单位通常被称为 ________，而资源所有权的单位通常被称为进程或任务。",[30,921,922,41,924],{},[23,923,40],{},[23,925,926],{},"thread (或 lightweight process)",[30,928,929,931,932,935],{},[23,930,49],{},"：再次强调了现代 OS 中将调度单位（",[23,933,934],{},"线程","）与资源分配单位（进程）进行解耦的设计。",[20,937,938],{},[23,939,940],{},"2. An example of an operating system that supports a single user process and a single thread is ________.",[27,942,943,948,955],{},[30,944,945,947],{},[23,946,34],{},"：支持单用户进程和单线程的操作系统的一个例子是 ________。",[30,949,950,41,952],{},[23,951,40],{},[23,953,954],{},"MS-DOS",[30,956,957,959],{},[23,958,49],{},"：MS-DOS 是典型的单任务、单线程操作系统，同一时间只能执行一个程序流。",[20,961,962],{},[23,963,964],{},"3. An example of an operating system that supports multiple user processes and multiple threads is ________.",[27,966,967,972,984],{},[30,968,969,971],{},[23,970,34],{},"：支持多个用户进程和多个线程的操作系统的一个例子是 ________。",[30,973,974,41,976,979,980],{},[23,975,40],{},[23,977,978],{},"Windows 2000 \u002F Solaris \u002F Linux \u002F Mac OS"," ",[981,982,983],"em",{},"(填任何一个现代 OS 即可)",[30,985,986,988],{},[23,987,49],{},"：目前主流的通用操作系统全部采用了多进程且每个进程支持多线程（M:N 架构）的设计模型。",[20,990,991],{},[23,992,993],{},"4. It is necessary to ________ the activities of various threads so they do not interfere with each other or corrupt data structures.",[27,995,996,1001,1008],{},[30,997,998,1000],{},[23,999,34],{},"：必须 ________ 各个线程的活动，以便它们不会相互干扰或破坏数据结构。",[30,1002,1003,41,1005],{},[23,1004,40],{},[23,1006,1007],{},"synchronize (同步)",[30,1009,1010,1012,1013,1016],{},[23,1011,49],{},"：由于线程共享内存，并发访问共享数据会引发竞态条件。必须采用互斥锁、信号量等机制对线程行为进行",[23,1014,1015],{},"同步 (synchronize)","，保证数据一致性。",[20,1018,1019],{},[23,1020,1021],{},"5. A process that cannot execute until some event occurs is said to be in the ________ state.",[27,1023,1024,1029,1036],{},[30,1025,1026,1028],{},[23,1027,34],{},"：在发生某事件之前无法执行的进程被称为处于 ________ 状态。",[30,1030,1031,41,1033],{},[23,1032,40],{},[23,1034,1035],{},"blocked (阻塞) \u002F waiting (等待)",[30,1037,1038,1040,1041,1044],{},[23,1039,49],{},"：当进程或线程请求 I\u002FO 操作或试图获取一把被占用的锁时，它将被 OS 挂起，交出 CPU 控制权，进入",[23,1042,1043],{},"阻塞 (blocked)"," 状态，直到等待的事件完成。",[20,1046,1047],{},[23,1048,1049],{},"6. The Clouds O\u002FS implements the concept of a thread as primarily an entity that can move among address spaces which represents the ________ Thread-to-Process relationship.",[27,1051,1052,1057,1064],{},[30,1053,1054,1056],{},[23,1055,34],{},"：Clouds 操作系统主要将线程的概念实现为可以在地址空间之间移动的实体，这代表了 ________ 线程对进程关系。",[30,1058,1059,41,1061],{},[23,1060,40],{},[23,1062,1063],{},"One-to-Many (1:M \u002F 一对多)",[30,1065,1066,1068],{},[23,1067,49],{},"：在分布式\u002F基于对象的操作系统（如 Clouds、Ra）中，一个执行线索（Thread）可以从一个对象的方法调用进入另一个对象，也就是穿梭于不同进程的地址空间中，形成**一（线程）对多（进程）**的模型。",[20,1070,1071],{},[23,1072,1073],{},"7. In a ________ system, the kernel can execute on any processor, and typically each processor does self-scheduling from the pool of available processes or threads.",[27,1075,1076,1081,1088],{},[30,1077,1078,1080],{},[23,1079,34],{},"：在 ________ 系统中，内核可以在任何处理器上执行，并且通常每个处理器都从可用进程或线程池中进行自我调度。",[30,1082,1083,41,1085],{},[23,1084,40],{},[23,1086,1087],{},"Symmetric Multiprocessing (SMP \u002F 对称多处理)",[30,1089,1090,1092,1093,1096],{},[23,1091,49],{},"：区别于主从架构，在 ",[23,1094,1095],{},"SMP"," 系统中所有 CPU 都是平等的，任何 CPU 都能执行操作系统内核代码，它们共享一个全局的就绪队列，自主进行调度和任务获取。",[20,1098,1099],{},[23,1100,1101],{},"8. In most modern computer systems, processors generally have at least one level of ________ that is private to the processor.",[27,1103,1104,1109,1116],{},[30,1105,1106,1108],{},[23,1107,34],{},"：在大多数现代计算机系统中，处理器通常具有至少一级对处理器私有的 ________。",[30,1110,1111,41,1113],{},[23,1112,40],{},[23,1114,1115],{},"cache (缓存)",[30,1117,1118,1120],{},[23,1119,49],{},"：现代多核处理器中，L1 Cache（甚至 L2 Cache）通常是每个核心（Core）私有的，而 L3 Cache 则是多个核心共享的。这就引出了前文提到的缓存一致性问题。",[20,1122,1123],{},[23,1124,1125],{},"9. With multiple active processes in an SMP system having potential access to shared address space or shared I\u002FO resources, care must be taken to provide effective ________.",[27,1127,1128,1133,1140],{},[30,1129,1130,1132],{},[23,1131,34],{},"：由于 SMP 系统中有多个活动进程潜在地访问共享地址空间或共享 I\u002FO 资源，因此必须小心提供有效的 ________。",[30,1134,1135,41,1137],{},[23,1136,40],{},[23,1138,1139],{},"synchronization (同步机制)",[30,1141,1142,1144,1145,1148],{},[23,1143,49],{},"：在真正的硬件并行（SMP）下，不仅同一进程的线程需要同步，整个 OS 内核级别的自旋锁（Spinlock）、互斥量等",[23,1146,1147],{},"同步 (synchronization)"," 原语对于保护共享内核数据结构至关重要。",[20,1150,1151],{},[23,1152,1153],{},"10. In the ________ O\u002FS architecture, functions are organized hierarchically and interaction only takes place between adjacent sections.",[27,1155,1156,1161,1168],{},[30,1157,1158,1160],{},[23,1159,34],{},"：在 ________ 操作系统架构中，功能是按层次化组织的，并且交互仅在相邻部分之间发生。",[30,1162,1163,41,1165],{},[23,1164,40],{},[23,1166,1167],{},"layered (分层)",[30,1169,1170,1172,1173,1176],{},[23,1171,49],{},"：这是早期的",[23,1174,1175],{},"分层式设计 (Layered architecture)","（如 Multics 早期的某些概念）。上层仅依赖下层提供的服务，限制了各模块之间的无序调用，方便调试和维护，但严格的层次跨越会损害性能。",[20,1178,1179],{},[23,1180,1181],{},"11. One advantage of the microkernel architecture is ________ allowing the addition of new services as well as the provision of multiple services in the same functional area.",[27,1183,1184,1189,1196],{},[30,1185,1186,1188],{},[23,1187,34],{},"：微内核架构的一个优点是 ________，允许添加新服务以及在同一功能区域提供多个服务。",[30,1190,1191,41,1193],{},[23,1192,40],{},[23,1194,1195],{},"extensibility (可扩展性)",[30,1197,1198,1200,1201,399],{},[23,1199,49],{},"：因为微内核的绝大多数服务是以用户态进程（服务器）运行的，要支持一个新的文件系统或网络协议，只需要添加一个新的用户态服务器即可，不需要修改内核代码，这就是极佳的",[23,1202,1203],{},"可扩展性 (extensibility)",[20,1205,1206],{},[23,1207,1208],{},"12. The basic form of communication between processes or threads in a microkernel O\u002FS is ________.",[27,1210,1211,1216,1223],{},[30,1212,1213,1215],{},[23,1214,34],{},"：在微内核操作系统中，进程或线程之间基本的通信形式是 ________。",[30,1217,1218,41,1220],{},[23,1219,40],{},[23,1221,1222],{},"messages (或 message passing \u002F 消息)",[30,1224,1225,1227,1228,1231],{},[23,1226,49],{},"：所有系统服务请求（如客户端请求文件服务）在微内核中都被打包成",[23,1229,1230],{},"消息 (messages)"," 进行发送和接收。",[20,1233,1234],{},[23,1235,1236],{},"13. In a Linux system, if the process has been terminated but, for some reason, still must have its task structure in the process table is in the ________ state.",[27,1238,1239,1244,1251],{},[30,1240,1241,1243],{},[23,1242,34],{},"：在 Linux 系统中，如果进程已终止，但由于某种原因仍必须将其任务结构保存在进程表中，则它处于 ________ 状态。",[30,1245,1246,41,1248],{},[23,1247,40],{},[23,1249,1250],{},"zombie (僵尸)",[30,1252,1253,1255,1256,1258,1259,1262,1263,1266],{},[23,1254,49],{},"：当 Linux 进程终止后，内核会释放它的绝大部分资源（内存、文件），但必须保留一个空的骨架（退出码等在 ",[365,1257,367],{}," 中），等待它的父进程调用 ",[365,1260,1261],{},"wait()"," 来收集。在这期间，它处于 ",[23,1264,1265],{},"僵尸 (zombie)"," 状态。",[20,1268,1269],{},[23,1270,1271],{},"14. In a Solaris system, a User-Level Thread (ULT) in the active state is assigned to a(n) ________ and executes while the underlying kernel thread executes.",[27,1273,1274,1279,1286],{},[30,1275,1276,1278],{},[23,1277,34],{},"：在 Solaris 系统中，处于活动状态的用户级线程 (ULT) 被分配给 ________，并在底层内核线程执行时执行。",[30,1280,1281,41,1283],{},[23,1282,40],{},[23,1284,1285],{},"LWP (Light-Weight Process \u002F 轻量级进程)",[30,1287,1288,1290,1291,1294],{},[23,1289,49],{},"：Solaris 线程库调度器将处于就绪态的 ULT 放置在一个活动队列中，然后将它们一对一地绑定到可用的 ",[23,1292,1293],{},"LWP"," 虚拟处理器上执行。",[20,1296,1297],{},[23,1298,1299],{},"15. In a Windows 2000 system, a process that has been selected to run next on a particular process moves from the Ready state to the ________ state.",[27,1301,1302,1307,1314],{},[30,1303,1304,1306],{},[23,1305,34],{},"：在 Windows 2000 系统中，被选择为要在特定处理器上接下来运行的线程（原题表述有微瑕，此处应指 thread 被调度）从就绪状态移动到 ________ 状态。",[30,1308,1309,41,1311],{},[23,1310,40],{},[23,1312,1313],{},"Standby (备用 \u002F 挂起待命)",[30,1315,1316,1318,1319,1322],{},[23,1317,49],{},"：在 Windows 操作系统的线程状态机中，当一个就绪（Ready）线程被调度器选中，准备在某颗 CPU 上执行，但在进行实际上下文切换的极短时间窗口内，它会处于 ",[23,1320,1321],{},"备用 (Standby)"," 状态。一旦上下文切换完成，即变为运行态 (Running)。",{"title":1324,"searchDepth":1325,"depth":1325,"links":1326},"",2,[1327,1328,1329],{"id":17,"depth":1325,"text":18},{"id":432,"depth":1325,"text":433},{"id":906,"depth":1325,"text":907},"md",{"order":1332},4,true,"\u002Fsource\u002Fcs\u002Fos\u002Ftestbank\u002Fchap4",{"title":5,"description":1324},"source\u002Fcs\u002Fos\u002Ftestbank\u002Fchap4","YW1nBabUxdDMZIsSO3zdS0zaw9gvlVqbD6xBFWTjJlM",null,1784032892822]