苏州大学操作系统概念第一章
- 格式:ppt
- 大小:5.90 MB
- 文档页数:50
原语:它是由若干条机器指令所构成,用以完成特定功能的一段程序,为保证其操作的正确性,它应当是原子操作,即原语是一个不可分割的操作。
设备独立性:指用户设备独立于所使用的具体物理设备。
即在用户程序中要执行I/O操作时,只需用逻辑设备名提出I/O请求,而不必局限于某特定的物理设备。
操作系统:操作系统是控制和管理计算机硬件和软件资源,合理地组织计算机的工作流程,以及方便用户的程序的集合。
其主要功能是实现处理机管理、内存管理、I/O设备管理、文件管理和用户接口。
文件:指具有文件名的若干相关元素的集合。
进程:进程是程序在一个数据集合上的运行过程,是系统进行资源分配和调度的一个独立的基本单位。
虚拟存储器:指具有请求调入功能和置换功能,能从逻辑上对内存容量进行扩充的一种存储器系统。
从用户观点看,虚拟存储器具有比实际内存大得多的容量。
这既方便了用户,又提高了内存的利用率和系统的吞吐量。
另外虚存容量的扩大是以牺牲CPU工作时间以及内、外存交换时间为代价的。
具有多次性,对换性和虚拟性三大主要特征文件目录:为了项用户提供对文件的存取控制及保护功能,而按一定规则对系统中的文件名,(亦可包含文件属性)进行组织所形成的表,称为目录表或文件目录。
SPOOLING:即同时联机外围操作,又称脱机操作。
在多道程序环境下,可利用多道程序中的一道程序,来模拟脱机的输入输出功能。
即在联机条件下,将数据从输入设备传送到磁盘,或从磁盘传送到输出设备。
设备管理中的数据传送控制方式有哪几种?分别简述如何实现的。
程序直接控制:由用户进程来直接控制内存或CPU和外设间的信息传送。
中断方式:进程通过CPU发出指令启动外设,该进程阻塞。
当输入完成时,I/O控制器通过中断请求线向CPU发出中断信号,CPU进行中断处理。
DMA方式:在外设和内存之间开辟直接的数据交换通路。
通道控制方式:CPU发出启动指令,指出通道相应的操作和I/O 设备,该指令就可启动通道并使该通道从内存中调出相应的通道指令执行。
操作系统概论第一章引论第一节系统硬件:光电磁机械等原理构成的各种物理部件的实体软件:从软件到实体的传递,再回传给操作人员需要的对应结果,这一条系统硬件组成:CPU,存储(主,辅),输入输出设备(是计算机和用户交互的借口部件)输入输出控制系统(与主存储器之间的信息传递)软件的组成:系统软件(靠硬件层的--操作系统,编译软件),支撑软件(其他软件的支撑,开发和维护—接口软件,软件开发工具,环境),应用软件(特定应用领域专用的软件)第二节系统简述:1.管理计算机软件资源2.控制程序执行3.改善人机交互界面4.提供应用软件支持的一款软件作用:集成,高效,管理硬件和软件功能:处理器管理,存储管理,文件管理,设备管理,相互协调工作!!第三节成形和基本类型a)第二代计算机的操作速度远远高于第一代计算机,那么,有计算机代替程序员控制开关势在必行,操作系统也就应运而生a)基本类型:批处理操作,分时处理操作,实时处理操作。
c)批处理操作:单道批处理器,多道普处理器,直到有运行结果或异常才会给用户提示;d)分时操作系统:一个计算机系统对应多个终端设备;用户直接和计算机进行交互,要求计系统能够快速对请求给出回应,就像一台独立支持自己请求的计算机(用户在终端设备上可以直接输入,调试,运行和修改自己的程序,并直接获取结果);e)实时操作操作:用于控制生产流水线,工业流程控制,监督和控制实验等计算机系统接收到外部信号后及时进行处理并且要在严格的时限内处理完接收事件第四节发展a)微机操作系统:最简单的微机b)网络操作系统:把计算机网络中的各台计算机系统有机地联合起来,为用户提供一种统一,经济而有效地使用各台计算机系统的方法,实现各计算机系统之间的资源共享;c)分布式操作系统:是由多台计算机主城的特殊的计算机网络,采用环形,星形,树形等模型结构结构统一性:用户在使用计算机系统的时候,完全不会感觉是在多台计算机构成透明性:用户在使用过程中,不会知道系统资源所在位置,服务的计算机对象和资源竞争的情况d)嵌入式操作系统:随着计算机在各个领域中的渗透,计算机硬件大部分或者全部隐藏和嵌入到各种应用系统中简述:运行在嵌入式系统中对各个部件,装置等资源进行统一调度的系统软件;特点:微型化,实时性,硬件配置较小,在保证应用宝能的前提下采用微型化,低功耗的结构。
《操作系统概念》重点内容总结第一章导论1、操作系统的功能作用:(1)作用:操作系统是控制和管理计算机系统内各种硬件和软件资源,有效地组织多道程序运行的系统软件,使用户与计算机之间的接口。
(2)功能:处理机管理、存储管理、设备管理、文件管理、用户接口。
2、操作系统的发展过程:(1)手工操作时期:人工干涉,用户独占。
(2)早期批处理时期:出现了完成作业自动转换工作的程序叫监督程序,包括早期联机批处理、早期脱机批处理。
(3)多道批处理系统:在内存中同时存放多道程序在管理程序的控制下交替执行,用户独占。
(4)分时系统:用户与主机交互。
(5)实时系统:具有专用性及时性。
(6)现代操作系统(网络操作系统和分布式操作系统):有网络地址,提供网络服务,实现资源共享。
第二章计算机系统结构1、计算机系统在硬件方面的保护:(1)双重模式操作:用户模式、监督程序模式,双重模式操作为人们提供了保护操作系统和用户程序不受错误用户程序影响的手段。
(2)I/O保护:定义所有I/O指令为特权指令,所以用户不能直接发出I/O指令,必须通过操作系统来进行。
(3)内存保护:对中断向量和中断服务程序进行保护,使用基址寄存器和界限寄存器。
(4)CPU保护:使用定时器防止用户程序运行时间过长,操作系统在将控制权交给用户之前,应确保设置好定时器,以便产生中断。
第三章操作系统结构1、操作系统的基本组成:进程管理、内存管理、文件管理、输入/输出系统管理、二级存储管理、联网、保护系统、命令解释系统。
2、系统调用的含义:系统调用提供了进程与操作系统之间的接口。
分为五类:进程控制、文件管理、设备管理、信息维护、通信。
3、操作系统设计所采用的结构:(1)简单结构:以较小、简单且功能有限的系统形式启动,但后来渐渐超过了其原来的范围,由于运行所用的硬件有限,它被编写成利用最小的空间提供最多的功能。
(2)分层方法:优点:模块化,简化了调试和系统验证(灵活性强);缺点:涉及对层的仔细认真的定义的困难,效率较差(3)微内核:优点:便于操作系统扩充,便于移植;缺点:关于哪些服务应保留在内核内,而哪些服务应在用户空间内实现,并没有定论。
苏州大学操作系统原理课程试卷(一)答案共4页一、填空题(20分,每空1分)1、进程通信的常用方式有直接通信和间接通信等。
2、如果P(S1)和P(S2)两个操作在一起,那么P操作的顺序至关重要,一个同步P操作与一个互斥P操作在一起时同步P操作在互斥P操作前。
而两个V操作的次序无关紧要。
3、P(S):表示申请一个资源;V(S)表示释放一个资源。
信号量的初值应该大于等于0 。
4、在请求式分页系统中,页框的分配中有一种方式称为固定分配。
固定分配有两种不同的方式,分别是平均分配和按比率分配。
5、在请求式分页存储管理系统中,不能在计算机中实现的页面淘汰算法是最佳算法,选择淘汰不再使用或最远的将来才使用的页的算法是先进先出算法,选择淘汰在主存驻留时间最长的页的算法是最近最少使用。
6、将作业地址空间中的逻辑地址转换为主存中的物理地址的过程称为地址转换。
7、访问磁盘时间由三部分组成寻道时间、旋转延迟时间和传输时间。
8、I/O设备的控制方式有轮询、中断和DMA等。
二、判断题(20分,每题4分,请说明正确与否的理由)1、分布式系统就是紧偶合系统。
错。
分布式系统是松散偶合系统。
2、在一个只有单个CPU的计算机中,进程不能并行操作。
错。
一个进程在利用CPU运行,另一个进程可以同时进行I/O操作,它们是并行的。
3、线程可以分为内核级(Kernel Thread)和用户级(User Thread)两种,操作系统不可以直接调度用户级的线程。
对。
4、有m个进程的操作系统出现死锁时, 死锁进程的个数为1<k≤m。
对。
5、在虚存系统中, 只要磁盘空间无限大, 作业就能拥有任意大的编址空间。
错。
作业的编制空间是由计算机的字长决定的。
三、简答题(20分,每题5分)1、为什么要在设备管理种引入缓冲技术?答:1)解决设备间速度的不匹配;2)减少中断频率;3)提高并行性。
2、CPU调度可能发生的时机有哪些?答:CPU调度可能发生在当一个进程:●从运行转到等待●运行转到就绪●从等待转到就绪●终止运行3、同步机构应遵循哪些原则?答:使用互斥区的原则:有空让进:当无进程在互斥区时,任何有权使用互斥区的进程可进入。
操作系统概念课后答案操作系统概念课后答案【篇一:操作系统概念第七版答案(含编程代码)】> chapter 11.1 in a multiprogramming and time-sharing environment, several users share the system simultaneously. this situation can result in various security problems. a. what are two such problems?b. can we ensure the same degree of security in a time-shared machine as in a dedicated machine? explain your answer.answer:a. stealing or copying one’s programs or data; using system resources (cpu, memory, disk space, peripherals) without proper accounting.b. probably not, since any protection scheme devised by humans can inevitably be broken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation.1.2 the issue of resource utilization shows up in different forms in different types of operating systems. list what resources must be managedcarefully in the following settings: a. mainframe or minicomputer systems b. workstations connected to serversc. handheld computersanswer:a. mainframes:memory and cpu resources, storage, network bandwidth.b. workstations: memory and cpu resoucesc. handheld computers: power consumption, memory resources.1.3 under what circumstances would a user be better off using a timesharing system rather than a pc or single-user workstation?answer: when there are few other users, the task is large, and the hardware is fast, time-sharingmakes sense. the full power of the system can be brought to bear o n the user’s problem. the problemcan be solved faster than on a personal computer. another case occurs when lots of other users need resources at the same time.a personal computer is best when the job is small enough to be executed reasonably on it and when performance is sufficient to execute the prog ram to the user’s satisfaction.1.4 which of the functionalities listed below need to be supported by the operating system for the following two settings: (a) handheld devices and (b) real-time systems. a. batch programmingb. virtual memoryc. time sharinganswer: for real-time systems, the operating system needs to support virtual memoryand time sharing in a fair manner. for handheld systems,the operating system needs to provide virtual memory, but does not need to provide time-sharing. batch programming is not necessary in both settings.1.5 describe the differences between symmetric and asymmetric multiprocessing.what are three advantages and one disadvantage of multiprocessor systems?answer: symmetric multiprocessing treats all processors as equals, and i/o can be processed on any cpu. asymmetric multiprocessing has one master cpu and the remainder cpus are slaves. the master distributes tasks among the slaves, and i/o isusually done by the master only.multiprocessors can save money by not duplicating power supplies,housings, and peripherals. they can execute programs more quickly and can have increased reliability. they are also more complex in both hardware and software than uniprocessor systems.1.6 how do clustered systems differ from multiprocessor systems? what is required for two machines belonging to a cluster to cooperate to provide a highly available service?answer: clustered systems are typically constructed by combining multiple computers into a single system to perform a computational task distributed across the cluster. multiprocessor systems on the other hand could be a single physical entity comprising of multiple cpus. a clustered system is less tightly coupled than a multiprocessorsystem.clustered systems communicate using messages, while processors in a multiprocessor system could communicate using shared memory.in order for twomachines to provide a highly available service, the state on the two machines should be replicated and should be consistently updated. when one of the machines fail, the other could then take-over the functionality of the failed machine.1.7 distinguish between the client-server and peer-to-peer models of distributed systems.answer: the client-server model firmly distinguishes the roles of the client and server. under this model, the client requests services that are provided by the server. the peer-to-peer model doesn’t have such strict roles. in fact, all n odes in the system are considered peers and thus may act as either clients or servers - or both. a node may request a service from another peer, or thenode may in fact provide such a service to other peers in the system.for example, let’s consider a syst em of nodes tha t share cooking recipes.under the client-server model, all recipes are stored with the server. if a client wishes to access a recipe, it must request the recipe from the specified server. using the peer-to-peer model, a peer node could ask other peer nodes for the specified recipe.the node (or perhaps nodes) with the requested recipe could provide it to the requesting node. notice how each peer may act as both a client (i.e. it may request recipes) and as a server (it may provide recipes.)1.8 consider a computing cluster consisting of twonodes running adatabase.describe two ways in which the cluster software can manage access to the data on the disk. discuss the benefits and disadvantages of each.answer: consider the following two alternatives: asymmetric clustering and parallel clustering. with asymmetric clustering, one host runs the database application with the other host simply monitoring it. if the server fails, the monitoring host becomes the active server. this is appropriate for providing redundancy. however, it does not utilize the potential processing power of both hosts. with parallel clustering, the database application can run in parallel on both hosts. the difficulty implementing parallel clusters is providing some form of distributed locking mechanism for files on the shared disk.1.9 how are network computers different from traditional personal computers? describe some usage scenarios in which it is advantageous to use network computers.answer: a network computer relies on a centralized computerfor most of its services. it can therefore have a minimal operating system to manage its resources. a personal computer on the other hand has to be capable of providing all of the required functionality in a standalonemanner without relying on a centralized manner. scenarios where administrative costs are high and where sharing leads to more efficient use of resources are precisely those settings where network computers are preferred.1.10 what is the purpose of interrupts? what are the differences between a trap and an interrupt? can traps be generated intentionally by a user program? if so, for what purpose?answer: an interrupt is a hardware-generated change-of-flow within the system. an interrupt handler is summoned to deal with the cause of the interrupt; control is then returned to the interrupted context and instruction. a trap is a software-generated interrupt. an interrupt can be used to signal the completion of an i/o to obviate the need for device polling. a trap can be used to call operating system routines or to catch arithmetic errors.1.11 direct memory access is used for high-speed i/o devices in order to avoid increasing the cpu′s execution load.a. how does the cpu interface with the device to coordinate the transfer?b. how does the cpu know when the memory operations are complete?c. the cpu is allowed to execute other programs while the dma controller istransferring data. does this process interfere with the execution of the user programs? if so, describe what forms ofinterference are caused.answer: the cpu can initiate a dma operation by writing values into special registers that can be independently accessed by the device.the device initiates the corresponding operation once it receives a command from the cpu. when the device is finished with its operation, it interrupts the cpu to indicate the completion of the operation.both the device and the cpu can be accessing memory simultaneously.the memory controller provides access to the memory bus in a fair manner to these two entities.a cpu might therefore be unable to issue memory operationsat peak speeds since it has to compete with the device in order to obtain access to the memory bus.1.12 some computer systems do not provide a privilegedmode of operation in hardware. is it possible to construct a secure operating system for these computer systems? give arguments both that it is and that it is not possible.answer: an operating system for a machine of this type would need to remain in control (or monitor mode) at all times. this could be accomplished by two methods:a. software interpretation of all user programs (like some basic,java, and lisp systems, for example). the software interpreter would provide, in software, what the hardware does not provide.b. require meant that all programs be written in high-level languages so that all object code is compiler-produced. the compiler would generate (either in-line or by function calls) the protection checks that the hardware is missing.1.13 give two reasons why caches are useful.what problems do they solve? what problems do they cause? if a cache can be made as large as the device for which it is caching (forinstance, a cache as large as a disk), why not make it that large and eliminate the device?answer: caches are useful when two or more components need to exchange data, and the components perform transfers at differing speeds.caches solve the transfer problem by providing a buffer of intermediate speed between the components. if the fast device finds the data it needs in the cache, it need not wait for the slower device. the data in the cache must be kept consistent with the data in the components. if a omponent has a data value change, and the datum is also in the cache, the cache must also be updated. this is especially a problem on multiprocessor systemswhere more than one process may be accessing adatum.acomponent may be eliminated by an equal-sized cache, but only if: (a) the cache and the component have equivalent state-saving capacity (that is,if the component retains its datawhen electricity is removed, the cache must retain data as well), and (b) the cache is affordable, because faster storage tends to be more expensive.1.14 discuss, with examples, how the problem of maintaining coherence of cached data manifests itself in the following processing environments:a. single-processor systemsb. multiprocessor systemsc. distributed systemsanswer: in single-processor systems, the memory needs to be updated when a processor issues updates to cached values. these updates can be performed immediately or in a lazy manner. in amultiprocessor system,different processors might becaching the same memory location in its local caches. when updates are made, the other cached locations need to be invalidated or updated. in distributed systems, consistency of cached memory values is not an issue. however, consistency problems might arise when a client caches file data.1.15 describe a mechanism for enforcing memory protectionin order to prevent a program from modifying the memory associated with other programs.answer: the processor could keep track of what locations are associated with each process and limit access to locations that are outside of a program’s extent. information regarding the exten t of a program’s memory could be maintained by using base and limits registers and by performinga check for every memory access.1.16 what network configuration would best suit the following environments? a. a dormitory floorb. a university campusc. a stated. a nationanswer:a. a dormitory floor - a lan.b. a university campus - a lan, possible a wan for very large campuses.c. a state - awan.d. a nation - a wan.1.17 define the essential properties of the following types of operating systems: a. batchb. interactivec. time sharingd. real timee. networkf. parallelg. distributedh. clusteredi. handheld【篇二:操作系统概念_第六版_重点部分_中文答案-】urposes of an operating system?1 to provide an environment for a computer user to execute programs on computer hardware in a convenient and ef?cient manner.2 to allocate the separate resources of the computer as needed to solve the problem given. the allocation process should be as fair and ef?cient as possible.3 as a control program it serves two major functions: (1) supervision of the execution of user programs to prevent errors and improper use of the computer, and (2) manage- ment of the operation and control of i/o devices.环境提供者,为计算机用户提供一个环境,使得能够在计算机硬件上方便、高效的执行程序? 资源分配者,为解决问题按需分配计算机的资源,资源分配需尽可能公平、高效 ? 控制程序监控用户程序的执行,防止出错和对计算机的不正当使用管理i/o 设备的运行和控制1.6 define the essential properties of the following types of operating systems: a. batchb. interactivec. time sharingd. real timee. networkf. distributeda. batch. jobs with similar needs are batched together andrun through the computer as a group by an operator or automatic job sequencer. performance is increased by attempting to keep cpu and i/o devices busy at all times through buffering, off-line operation, spooling, and multiprogramming. batch is good for executing large jobs that need little interaction; it can be submitted and picked up later.b. interactive. this system is composed of many short transactions where the results of the next transactionmay be unpredictable. response time needs to be short (seconds) since the user submits and waits for the result.c. time sharing.thissystemsuses cpu scheduling and multiprogramming to provide economical interactive use of a system. the cpu switches rapidly from one user toanother. instead of having a job de?ned by spooled card images, each program readsits next control card from the terminal, and output is normally printed immediately to the screen.d. real time. often used in a dedicated application, this system reads information from sensors and must respond withina ?xed amount of time to ensure correct perfor- mance.e. network.f. distributed.this system distributes computation among several physical processors. the processors do not share memory or a clock. instead, each processor has its own local memory. they communicate with each other through various communication lines, such as a high-speed bus or telephone line.a. batch相似需求的job分批、成组的在计算机上执行,job由操作员或自动job程序装置装载;可以通过采用buffering, off-line operation, spooling, multiprogramming 等技术使cpu 和 i/o不停忙来提高性能批处理适合于需要极少用户交互的job。
《操作系统概念》学习笔记-第⼀章【操作系统概念学习笔记⼀】计算机系统可以分为四个部分1. 计算机硬件2. 操作系统3. 系统程序与应⽤程序4. ⽤户操作系统的设计⽬的是为了⽤户使⽤⽅便,性能是次要的,不在乎资源使⽤率可以将系统看作资源分配器。
⽬前没有⼀个关于操作系统的⼗分完整的定义。
操作系统的基本⽬的是:执⾏⽤户程序,并能更容易的解决⽤户问题⼀个⽐较公认的定义是:操作系统是⼀直运⾏在计算机上的程序(通常称为内核),其他程序则为系统程序和应⽤程序。
现代通⽤计算机系统由⼀个或多个CPU和若⼲设备控制器通过共同的总线相连⽽成,该总线提供了对共享内存的访问。
内存控制器:确保对共享内存的有序访问。
引导程序:计算机开始运⾏时的⼀个初始化程序,通常位于ROM或EEPROM中,成为计算机硬件中的【固件】。
事件的发⽣通常通过硬件或软件中断来表⽰。
硬件可随时通过系统总线向CPU发出信号,以触发中断。
软件通过执⾏特别操作如系统调⽤(system call)(也称为监视器调⽤(monitor call))也能触发中断。
中断处理程序:发出中断请求的那个程序。
处理转移的简单⽅法是调⽤⼀个通⽤⼦程序以检查中断信息,接着,该⼦程序会调⽤相应的中断处理程序。
因为只有少量的预先定义的中断,所以可使⽤中断处理⼦程序的指针表,通过指针表可间接调⽤中断处理⼦程序,⽽不需要通过其他中间⼦程序。
通常,指针表位于低地址内存(前100左右)。
这些位置包含各种设备的中断处理⼦程序的地址,这种地址的数组或中断向量可通过唯⼀设备号来索引,以提供设备的中断处理⼦程序的地址。
内存(RAM)是处理器可以直接访问的唯⼀⼤容量存储区域。
DRAM是动态随机访问内存,是⼀种半导体技术实现的⼀组内存字的数组,每个字都有其地址。
通过对特定内存地址执⾏⼀系列load或store指令来实现交互。
⼀个典型的指令执⾏周期(在冯诺依曼体系结构上执⾏时):1.⾸先从内存中获取指令,并保存在指令寄存器。
操作系统概论学习笔记(1—4章+5章部分详细版)第一章引论1.1 计算机系统计算机系统包括:计算机硬件、计算机软件1.1.1 计算机硬件是计算机系统的最内层计算机硬件的组成:1.中央处理器(运算器、控制器):对信息进行高速运算和处理。
2.存储器(主存储器、辅助存储器):存放各种程序和数据。
3.输入和输出控制系统:管理外围设备与主存储器之间的信息传递。
4.各种输入输出设备:是计算机与用户间的交互接口部件。
1.1.2 计算机软件是计算机系统的最外层计算机软件定义:人与计算机硬件之间的接口界面计算机软件分类:1.系统软件:是计算机系统中最靠近硬件层次的软件,是不可缺少的软件。
(例:操作系统(计算机系统软件的核心)、编译程序、监控管理程序)2.支撑软件:是支撑其他软件的开发与维护的软件。
(例:接口软件、软件开发工具、环境)3.应用软件:是特定应用领域的专用软件。
是解决用户实际问题的软件。
(例:订票软件、办公软件等)1.2 操作系统1.2.1 什么是操作系统操作系统概念:是管理计算机系统资源、控制程序的执行、改善人机界面和为应用软件提供支持的一种系统软件。
1.2.2 操作系统的作用1.管理计算机系统的资源2.为用户提供方便的使用接口3.具有扩充硬件的功能,为用户提供良好的运行环境☆计算机配置了操作系统后可提高效率,且便于使用。
1.2.3 操作系统的功能1.处理器管理:多道程序环境下的处理器调度2.内存管理:内存的分配回收、地址重定位、内存共享与保护、内存扩充3.文件管理:文件的“按名存取”;文件的存储、检索、共享、保护等问题4.设备管理1.3 操作系统的形成与基本类型1.3.1 批处理操作系统1.单道批处理系统:每次只允许一个作业执行2.多到批处理系统:内存中同时有多个作业,它们共享计算机系统中的资源优点:提高了处理器的利用率;系统吞吐量大缺点:一旦将作业提交给系统,用户无法控制作业的执行分时操作系统概念:1.若干个用户分享处理器的时间如何分享:轮流占用处理器,规定每个用户占用处理器的时间,称为时间片。
1、
2、试从调度性,并发性,拥有资源及系统开销几个方面对进程和线程进行比较
a、调度性:os中调度分派资源的基本单位是进程,而线程把进程作为资源拥有的基本单位;
b、并发性:在引入线程的os中不仅进程之间可以相互切换亦可并发执行;
c、资源拥有:进程是拥有资源的基本单位,线程一般不拥有资源,而访问其隶属进程资源;
d、系统开销:创建或撤销进程时系统都要为之分配和回收资源,os所付出的开销大于在创建或撤销线程时的开销。
3、何谓用户级线程和内核级线程?
用户线程:指不需要内核支持而在用户程序中实现的线程,其不依赖于操作系统核心,应用进程利用线程库提供创建、同步、调度和管理线程的函数来控制用户线程。
内核线程:由操作系统内核创建和撤销。
内核维护进程及线程的上下文信息以及线程切换。
一个内核线程由于I/O操作而阻塞,不会影响其它线程的运行。
4、死锁条件
A、互斥;
B、占有并等待;
C、非抢占;
D、循环等待;。