Chapter 2 Processes and threads
操作系统课件
Operating System
22
哈工大计算机科学与技术学院
进程状态转换
在进程执行过程中,其状态会不断变化
运行
一个CPU上正 在执行的进程
就绪
准备运行的进程
Harbin Institute of Technology
Operating System
23
哈工大计算机科学与技术学院
进程状态转换
(1) 就绪 (2) 运行 运行: 该进程被配遣(Dispatch) 就绪: 运行并中断,如时间片用完
将其它资源加以限制后分配给不同的进程
如内存映射: Give each process their own address space 内核/用户模式: Arbitrary multiplexing of I/O through system calls
Harbin Institute of Technology
Harbin Institute of Technology
Operating System
16
哈工大计算机科学与技术学院
进程 vs. 程序
程序: 代码 + 数据
是静态的
int c; int main() { printf(“hello”); }
进程是程序关于某数据集 stack 上的一次运行活动
Harbin Institute of Technology
Operating System
7
哈工大计算机科学与技术学院
并发引出的问题
多个用户对资源的共享
单一的CPU,单一的DRAM,单一的I/O设如何分配 如何让用户(程序员)感觉到是独占机器
操作系统需要协调所有的活动
需求分析-FAQs
1.What is object technology? What do you perceive as object technology’s strength? It’s weakness?OOT is such a technology that facing the objective worl d and the question realm and using the generally thinking way of human-beings to acknowledge the nature world to describe some things.OOT fit the thinking way of human-beings and easy to protect and functions’ addition and decrease are also become more convenient. And OOT’s reusing is more strengthen.weakness2. What is UML? List at least three benefits of developing with UML.UML(Unified Modeling Language)is used to proceeding the visual model of software dense system.(1)UML can help to express things exactly.(2)UML can help programmer to write a better code.(3)UML can accelerate the procedure’s development.3.What process characteristic best fit the UML? Describe each characteristic.4.What is a use-case driven process? What is use-case? What are the benefits of use case?It is the use-case become a guidance o f program.Use-case is a description of system functions.Use-case can help us to get a general impression of the determined system.5.What is system’s architecture? What is an architecture-centric Process?System’s architecture is an overall construction of a system, it include the concept, the requirements and all of the detail in implementing the project. The architecture-centric process is a process that exploit a software use the system’s architecture.6.What is iteration? What are the benefits of Iterative Development?Iteration is a way of exploiting the software that finishing the software in several steps, and it need the customer present his advices after every step in order to ensure the product can fit to the requirements of the customer’s. Iteration can ensure a lower risk in a large project.7.What are the basic principles of OO technology? Describe each in detail.Abstraction, it report those important properties connect to the applications.Encapsulation, it can cover details of implementation and is the basis of the modularity.Modularity, it break complex part into simple piecesHierarchy, it provides a method that can let the son class to get data from father class.8.What is use case model? Which artifacts can be included in a use case model?9.List three types of relationships existed between different use cases and give examples.Generalization, Include, Extend.Generalization, apples and bananas can be generalized as fruit.Include, the banana peel is included in the banana.Extend, we can eat the banana, but we can also smash it and mixed it with yogurt and drink it, drinking is an extension.10.Explain the following diagram and their elements with examples.1) Use case diagram 2) Activity diagram 3) Sequence diagram 4) Collaboration diagram5) Class diagram 6) state chart diagram 7) Deployment diagram1)2)3)4)5)6)7)11.Describe the similarities and differences between the sequence diagram and collaborationdiagram.They are both interactive diagram, but collaboration diagram don’t care about when the information be transferred.12.Define the different relationships in class diagram: dependency, association, aggregation,composition, generalization.Dependency, is a connection during two classes, one class depend another class.Association, it let a class acquire another class’s functions and attributes.Aggregation, it is the association but those two classes are in different levels, one is entity but the other one is part.Composition, it is a kind of aggregation, it demands the object that represent the entity i n responsible of the life cycle of the object that represent the part.Generalization, it represents the hierarchy between two classes.13.What is a node in deployment diagram? List two different types of nodes.Node in deployment diagram always represent a device .14.Describe the extensibility mechanisms of UML.15.What is the function of Stereotypes?Give two examples of stereotypes.16.Explain the six best practices of software engineering.1)Iteration 2)Manage requirements 3)Module-basis architecture 4)visualization modeling5) software quality’s confirmation 6)Control the changes of software.17.What is RUP? How many phases are there in RUP? Describe each phase’s purpose andmilestone :.It is a programming exploitation methodology which is OOT and web-basis.Inception, Elaboration, Construction, TransitionInception: Constructing the business cases of system and confirm the edge of the project.Lifecycle objective.Elaboration: Analysis the problem domain.Lifecycle architecture.Construction: Product’s exploitation.Initial operation.Transition: Ensuring the software is usable to the customer.Product release. and briefly describe the “4+1”views of architecture.Ans:Which of the four views are:Logical View which is the logical relationship around the objects,Process View which is the view that show the actions of the objects or software actions, Deployment View which is to show the relationship between the module of the objects Implementation View which is the software implementations.And the one view can be Use-Case View.19.What is the difference between analysis and design?The analysis focus on understanding of de problem,but the design focus on the understanding of the solution.20.Please describe the whole process of OO analysis and design with UML.Ans:1.Build the requirement model-the plan for the requirement2.Build the basic model-Class diagram3.Build the assistant diagram4.Design the protocol of the model5.Prototype Development21.What is a layered architecture? Give examples of typical layers.Ans:A layered architecture can be described as the “separation of responsibility which is to say that each layer is responsible for a finite amount of work.For instance,a company may has its enterprise architecture.The layers of the manager and the layers of the employees.They have the responsibilities themselves and they have their own layers.22.What are analysis mechanisms? What are design mechanisms? Give examples.Ans:Analysis mechanisms can be a process which may run through the whole analysis.And so does the design mechanisms.For instance,a analysis mechanisms may contains Auditing, Communication and so on.23.What is an analysis class? Name and describe the three analysis stereotypes. Give examples. Boundary Classes: Behavior that involves communication with an actorEntity Classes: Behavior that involves the data encapsulated within the abstractionControl Classes: Behavior specific to a use case or part of a very important flow of events24.What is Use-case realization? What‘s your understandings about the benefit of the use-caserealization structure.Ans:The Use-case realization is a method to realize the problem that we should analyses.The use-case realization structure helps to organize the model elements needed to realize the use cases in the design model.25.Please describe the use case analysis steps in OOA/DAns:Use-Case Analysis may contain five Steps:(1)Identify Use Cases, Supplement the Use-Case Description(2)Identify Domain Class and relationshipsFor each Use-Case RealizationFind Classes from Use-Case BehaviorDistribute Use-Case Behavior to Classes(3)Define the System Sequence Diagram for each use case,For each resulting analysis classDescribe ResponsibilitiesDescribe Attributes and AssociationsQualify Analysis Mechanisms(4)Produce an operation,Unify Analysis Classes(5)CheckpointsUse-Case Design StepsDescribe interaction between design objectsSimplify sequence diagrams using subsystemsDescribe persistence related behaviorRefine the flow of events descriptionUnify classes and subsystems26.What’s the package, and why we need package?Ans:Package is a universal mechanism that organize other elements of the models together.Why we need?If a system has a lot of structures and we have to know more about the structures,then we should point to the so many elements that the systems or the structures have.And at that time we can find that this may big a complex and hard work.So the package has been developed for this. Package is a universal mechanism that organize other elements of the models together.So we can analyses the system from the bigger layers instead of the great number of the element.27.What is a subsystem? What is an interface? How does a subsystem differ from a package? Ans: A subsystem is a coherent and somewhat independent component of a larger system.It is an element of the model,and it contains the semantics of the packages and the classes.An interface can be an operation about the subsystem.A subsystem realizes one or more interfaces that define its behavior.28.What is the purpose of describing the run-time architecture? How to model the process view? Ans:Describing the run-time architecture’s purpose is:Analyze concurrency requirements,Identify processes and threads,Identify process lifecycles, Map processes onto the implementation and Distribute model elements amongProcesses.The Process View is an “architecturally significant” slice of theprocesses and threads of the Design Model.Processes can be modeled using:1.Active classes (Class Diagrams) and Objects(Interaction Diagrams)ponents (Component Diagrams)29.What is the purpose of describing the distribution? How to model the deployment view? Ans:The purpose is to Reduce processor load.For the Special processing requirements,Scaling concerns,Economic concerns and Distributed access to the system.The Deployment View is an “architecturally significant” slice of the Deployment Model.The deployment view will contain nodes and connections.Connection lines are used to connect the nodes that will be P hysical run-time computational resource,Processor node and Device node.And connections may contain Communication mechanism,Physical medium and Software protocol30.Describe the 3 typical distribution patterns, C/S , B/Sand P2P.Ans:C/S:Client/Server, in network connections pattern, besides coordinated net, but also has another form network, namely client/server net, Client/Server. In the client/server network, the server is the network core, but the client is the network foundation, the client dependence server obtains the network resource which needs, but the server provides the network for the client to resources.B/S: Browser/Server,is called as Browser/Server patterns.It is developing as the development of Internet,it is improved from the C/S.P2P: Peer-to-peer network. According to the network in the shared resource way's difference, the local area network has two kind of configurations of organization: One kind is the peer-to-peer network (), another kind is the workstation/server structure. Between peer-to-peer network's computer may correspond mutually and the shared resource (document, peripheral device and so on); But in the workstation/server structure's network may the shared resource place on special purpose computer - server (server), between workstation not mutually direct shared resource.31.What is the difference between the process models of agile and RUP?Ans: Rational Unified Process is a whole software process,but the process models of agile may be a process in an Architecture or in part of a software.That is to say the RUP may contain the process models of agile.32Please outline the phases and workflows of RUP (Score 5) . 10It is a programming exploitation methodology which is OOT and web-basis.Inception, Elaboration, Construction, TransitionInception: Constructing the business cases of system and confirm the edge of the project.milestone : Lifecycle objective.Elaboration: Analysis the problem domain.milestone : Lifecycle architecture.Construction: Product’s exploitation.milestone : Initial operation.Transition: Ensuring the software is usable to the customer.milestone : Product release.1.(Business Modeling)2.(Requirement)3.(Analysis & Design)4.(Implementation)5.(Test)6.(Deployment)7.Configuration & Change Management8.(Project Management)9.(Environment)RUP中有9个核心工作流,分为6个核心过程工作流(Core Process Workflows)和3个核心支持工作流(Core Supporting Workflows)。
TPI事务性流程改善
Mkt.
R&D
Product Production Design Preparation Purch. Manuf.
Dist.
Service
Transactional Kaizens 事务改善
Total Value Stream after Kaizen 改善后的全部价值流程 6 months/6个月
Customer Needs 1 Every 13 Minutes 每13分钟客户需求1个
Customer Demand 客户需求
18 16 Loading (minutes) 14 12 10 8 6 4 2 0
Processor 1
Processor 2
Processor 3
Loan Application 借贷申请
7
Transactional Processes 事务性过程
Everything we do is part of a process… 我们做得每一件事情都是过程的一部分… …all processes can be improved …所有的过程都是可以改善的
Process/过程 Output/输出 Inputs/输入
Marketing 市场营销 R&D 研发 Product Design 产品设计 Production Preparation 生产准备 Purch. 采购 Manu. Distribution 制造 交货 Service 服务
Mfg Kaizens 制造改善
Total Value Stream/全部价值流过程
Incoming Loan Sorting 借贷斟选 10 Minutes/10分钟
Loan Calculations 借贷计算 8 Minutes/8分钟
基于Android开发的外文文献
AndroidAndroid, as a system, is a Java-based operating system that runs on the Linux 2.6 kernel. The system is very lightweight and full featured. Android applications are developed using Java and can be ported rather easily to the new platform. If you have not yet downloaded Java or are unsure about which version you need, I detail the installation of the development environment in Chapter 2. Other features of Android include an accelerated 3-D graphics engine (based on hardware support), database support powered by SQLite, and an integrated web browser.If you are familiar with Java programming or are an OOP developer of any sort, you are likely used to programmatic user interface (UI) development—that is, UI placement which is handled directly within the program code. Android, while recognizing and allowing for programmatic UI development, also supports the newer, XML-based UI layout. XML UI layout is a fairly new concept to the average desktop developer. I will cover both the XML UI layout and the programmatic UI development in the supporting chapters of this book.One of the more exciting and compelling features of Android is that, because of its architecture, third-party applications—including those that are “home grown”—are executed with the same system priority as thosethat are bundled with the core system. This is a major departure from most systems, which give embedded system apps a greater execution priority than the thread priority available to apps created by third-party developers. Also, each application is executed within its own thread using a very lightweight virtual machine.Aside from the very generous SDK and the well-formed libraries that are available to us to develop with, the most exciting feature for Android developers is that we now have access to anything the operating system has access to. In other words, if you want to create an application that dials the phone, you have access to the phone’s dialer; if you want to create an application that utilizes the phone’s internal GPS (if equipped), you have access to it. The potential for developers to create dynamic and intriguing applications is now wide open.On top of all the features that are available from the Android side of the equation, Google has thrown in some very tantalizing features of its own. Developers of Android applications will be able to tie their applications into existing Google offerings such as Google Maps and the omnipresent Google Search. Suppose you want to write an application that pulls up a Google map of where an incoming call is emanating from, or you want to be able to store common search results with your contacts; the doors of possibility have been flung wide open with Android.Chapter 2 begins your journey to Android development. You will learn the how’s and why’s of using specific development environments or integrated development environments (IDE), and you will download and install the Java IDE Eclipse.Application ComponentsA central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises.For this to work, the system must be able to start an application process when any part of it is needed, and instantiate the Java objects for that part. Therefore, unlike applications on most other systems, Android applications don't have a single entry point for everything in the application (no main() function, for example). Rather, they have essential components that the system can instantiate and run as needed. There are four types of components:ActivitiesAn activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the Activity base class.An application might consist of just one activity or, like the text messaging application just mentioned, it may contain several. What the activities are, and how many there are depends, of course, on the application and its design. Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched. Moving from one activity to another is accomplished by having the current activity start the next one.Each activity is given a default window to draw in. Typically, the window fills the screen, but it might be smaller than the screen and float on top of other windows. An activity can also make use of additional windows —for example, a pop-up dialog that calls for a user response in the midst of the activity, or a window that presents users with vital information whenthey select a particular item on-screen.The visual content of the window is provided by a hierarchy of views — objects derived from the base View class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views (those at the bottom of the hierarchy) draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity's interaction with the user takes place.For example, a view might display a small image and initiate an action when the user taps that image. Android has a number of ready-made views that you can use — including buttons, text fields, scroll bars, menu items, check boxes, and more.A view hierarchy is placed within an activity's window by the Activity.setContentView() method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.)ServicesA service doesn't have a visual user interface, but rather runs in the background for an indefinite period of time. For example, a service might play background music as the user attends to other matters, or it mightfetch data over the network or calculate something and provide the result to activities that need it. Each service extends the Service base class.A prime example is a media player playing songs from a play list. The player application would probably have one or more activities that allow the user to choose songs and start playing them. However, the music playback itself would not be handled by an activity because users will expect the music to keep playing even after they leave the player and begin something different. To keep the music going, the media player activity could start a service to run in the background. The system would then keep the music playback service running even after the activity that started it leaves the screen.It's possible to connect to (bind to) an ongoing service (and start the service if it's not already running). While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback.Like activities and the other components, services run in the main thread of the application process. So that they won't block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback). See Processes and Threads, later.Broadcast receiversA broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts —for example, to let other applications know that some data has been downloaded to the device and is available for them to use.An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the BroadcastReceiver base class.Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user's attention in various ways — flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in the status bar, which users can open to get the message.Content providersA content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system,in an SQLite database, or in any other manner that makes sense. The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.See the separate Content Providers document for more information on using content providers.Whenever there's a request that should be handled by a particular component, Android makes sure that the application process of the component is running, starting it if necessary, and that an appropriate instance of the component is available, creating the instance if necessary.Key Skills & Concepts● Creating new Android projects● Working with Views● Using a TextView● Modifying the main.xml fileCreating Your First Android Project in EclipseTo start your first Android project, open Eclipse. When you open Eclipse for the first time, it opens to an empty development environment (see Figure 5-1), which is where you want to begin. Your first task is to set up and name the workspace for your application. Choose File | New | Android Project, which will launch the New Android Project wizard.CAUTION Do not select Java Project from the New menu. While Android applications are written in Java, and you are doing all of your development in Java projects, this option will create a standard Java application. Selecting Android Project enables you to create Android-specific applications.If you do not see the option for Android Project, this indicates that the Android plugin for Eclipse was not fully or correctly installed. Review the procedure in Chapter 3 for installing the Android plugin for Eclipse to correct this.The New Android Project wizard creates two things for youA shell application that ties into the Android SDK, using the android.jar file, and ties the project into the Android Emulator. This allows you to code using all of the Android libraries and packages, and also lets you debug your applications in the proper environment.Your first shell files for the new project. These shell files contain someof the vital application blocks upon which you will be building your programs. In much the same way as creating a Microsoft .NET application in Visual Studio generates some Windows-created program code in your files, using the Android Project wizard in Eclipse generates your initial program files and some Android-created code. In addition, the New Android Project wizard contains a few options, shown next, that you must set to initiate your Android project. For the Project Name field, for purposes of this example, use the title HelloWorldText. This name sufficiently distinguishes this Hello World! project from the others that you will be creating in this chapter.In the Contents area, keep the default selections: the Create New Project in Workspace radio button should be selected and the Use Default Location check box should be checked. This will allow Eclipse to create your project in your default workspace directory. The advantage of keeping the default options is that your projects are kept in a central location, which makes ordering, managing, and finding these projects quite easy. For example, if you are working in a Unix-based environment, this path points to your $HOME directory.If you are working in a Microsoft Windows environment, the workspace path will be C:/Users/<username>/workspace, as shown in the previous illustration. However, for any number of reasons, you may want to uncheck the Use Default Location check box and select a different location for your project. One reason you may want to specify a different location here is华东交通大学simply if you want to choose a location for this specific project that is separate from other Android projects. For example, you may want to keep the projects that you create in this book in a different location from projects that you create in the future on your own. If so, simply override the Location option to specify your own custom location directory for this project.页脚内容。
操作系统上机 西电科大实验环境概述
《操作系统实验课程》实验环境概述主讲:黄伯虎内容安排WRK简介实验环境的建立调试工具的使用WRK全称“Windows Research Kernel”,是微软公司“Windows Academic Program”的组成部分。
Windows Academic ProgramThe Windows Academic Program provides universities with curriculum materials, Windows kernel source code, and aproject environment for teaching operating system principles using Windows.Components:¾Windows Operating System Internals Curriculum Resource Kit¾Windows Research Kernel¾ProjectOZWRK包含两部分内容:¾Windows XP x64和Windows Server 2003 SP1操作系统的大部分内核源代码;¾一个用于教学和研究的Windows内核实验平台。
作用¾通过WRK,使用者可以阅读、修改、编译Windows内核源代码,并在给定的环境下运行和测试;¾可以观察Windows内核的运行情况;¾可以深度观测应用程序的运行情况。
WRK包含NTOS内核中以下部分的源代码: 进程(Processes)线程(Threads)本地过程调用(LPC)虚拟内存(Virtual memory)调度器(Scheduler)对象管理器(Object manager)I/O管理器(I/O manager)同步(Synchronization)辅助线程(Worker threads)内核堆管理器(Kernel heap manager)其他的NTOS内核功能不过包括的部分硬件抽象层(Hardware Abstraction Layer) 文件系统(File systems)网络栈(Network stacks)设备驱动(Device drivers)这些组件以动态链接库的形式提供,以支持系统运行。
操作系统2进程(processes)和线程(threads)
• Windows: CreateProcess()
进程的创建 创建之后
• 一一个父父进程,一一个子子进程 • 两个进程各自自维护自自己己的地址空间(相互独立立) • 无无法共享可写的内存
• (有的系统共享可读内存,如程序的内容)
进程的终止止 触发终止止的条件
• Normal exit (voluntary). • exit(0), ExitProcess()
One program counter
Four program counters
A
Process switch
D
B
C
Process
C
A
B
C
D
B
A
D
Time
(a)
(b)
(c)
Figure 2-1. (a) Multiprogramming four programs. (b) Conceptual model of four independent, sequential processes. (c) Only one program is active at once.
Memory management Pointer to text segment info Pointer to data segment info Pointer to stack segment info
File management Root directory Working directory File descriptors User ID Group ID
线程
• 进程 • 每个进程控制着一一块独立立的地址空间 • 可不不可能有多个“进程”(线程)来控制同一一块地址空间?
0120408048_操作系统_教学大纲_英文
Modern Operating Systems SyllabusCurriculum Num:0120408048 Suited Specialty:Software engineering Written by:Wang chunshuang Suited by:2008 grades1. Feature and Target of the CourseFeature“Modern Operating Systems” is an important specialized foundational course. It is a computer system software curriculum involving much hardware knowledge. This course plays the role of links computer software and hardware curriculum together. The operating systems manage the computer system resources; it is the interface of all other software and computer hardware. All users can obtain services which operating system provides when they are using computer.TargetThis course trains students to understand and grasp the basic principles and the design skills of computer operation systems. Through studying this curriculum, the students can understand the basic concepts and main functions of operating systems, grasp the usage and the general managements of some typical operating systems (for example Windows and UNIX), understand how those operating systems are organized and operated, and then, by learning this course, students can build foundation for their later studying and working.2.The basic contents of the courseOperating conceptsA.What is an operating systemB.History of operating systemsC.The operating system zooputer hardware reviewE.Operating system conceptsF.System callsG.Operating system structureProcesses and threadsA.ProcessesB.ThreadsC.Inter-process communicationD.Classical IPC problemsE.SchedulingDeadlocksA.ResourcesB.Introduction to deadlocksC.The ostrich algorithmD.Deadlock detection and recoveryE.Deadlock avoidanceF.Deadlock preventionMemory managementA.Basic memory managementB.SwappingC.Virtual memoryD.Page replacement algorithmsE.Modeling page replacement algorithmsF.Design issues for paging systemsG.Implementation issuesH.SegmentationInput/outputA.Principles of I/O hardwareB.Principles of I/ O softwareC.I/O software layersD.DisksFile systemsA.FilesB.DirectoriesC.File system implementation3. The Basic requirementFirst fraction: Operating systems conceptsA.This fraction briefly introduces the concepts of operating systems, computer hardware review.B.The emphasis is the concepts of operating system.Second fraction: Processes and threadsA.This fraction introduces the processes, processes creation and termination, threads and threadsimplementation, inter-process communication, classical IPC problems, process scheduling algorithms, and so on…B.The emphasis is to grasp the inter-process communication and process scheduling algorithm.Third fraction: DeadlocksA.This fraction introduces the type of resources and the strategies of dealing with deadlocks.B.The emphasis is to grasp deadlock prevention,deadlock avoidance, deadlock detection and recovery.A.This fraction introduces basic memory management, paging memory management andsegmentation memory management.B.The emphasis is to understand paging memory management and page replacementalgorithms.Fifth fraction: Input/OutputA.This fraction introduces I/O hardware and software, and disks.B.The emphasis is to grasp I/O software and disk scheduling algorithm.Sixth fraction: File systemsA.This fraction introduces files and directories, file system implementation.B.The emphasis is to grasp the basic contents of files and implementation methods of filesystem.4. Teaching and studyingLecture classExperiment/practice classHomework5. The relation between this course and other coursesPrior courses:Computer organization and structureDiscrete MathematicsData StructureC programming design6. Experiment (practice) teaching contents and requirement1. Each student should do one experiment, all 4 periods; and each student should writes out experimentreport.2.Each student should have one practice class, all 4 periods.7. Advised Period allocation8. Reference[1] A ndrew S. Tanenbaum著,Modern Operating Systems,China Machine Press,2004[2] (美)Willialm Stallings著陈渝译,操作系统----精髓与设计原理,电子工业出版社,2006[3] Lubomir F.Bic Alan C.Shaw著,操作系统原理,清华大学出版社,2005[4] 汤子瀛哲凤屏汤小丹著,计算机操作系统,西安电子科技大学出版社,2005。
操作系统第五章的中英文对照
第五章08软一裴晓禹并发性:互斥和同步Concurrency: Mutual Exclusion and Synchronization1并发性的概述:1:操作系统设计中的核心问题是关于进程和线程的管理:The central themes of operating system design are all concerned with themanagement of processes and threads:1:多道程序设计技术。
Multiprogramming2:多处理技术。
Multiprocessing3:分布式处理技术。
Distributed processing2:操作系统的基础是并发性。
Fundamental to operating system design is concurrency3:支持并发进程的基本需求是加强互斥的能力。
The Basic requirement for support of concurrency is the ability to enforce mutual exclusion2:并发出现在以下三种不同的上下文中:1:多个应用程序2:结构化应用程序3:操作系统结构3:并发性原理1:交替。
2:重叠。
3:多道程序设计系统的一个基本特性:进程的相对执行速度不可预测。
4:并发性带来的困难1:全局资源的共享充满了危险。
2:粗奥做系统很难对分配资源进行最优化的管理。
3:定位程序设计错误时非常困难的。
5:一个简单的例子:另一个简单的例子:6:竞争条件:1:定义:竞争条件发生在当多个进程或者线程在读写数据时,其最终的结果依赖于多个进程指令的执行顺序。
2:紊乱状况的解决方案:控制资源共享的通道。
7:进程的交互:进程之间相互之间知道对方是否存在的程度的三种情况: 1:进程之间相互不知道对方。
2:进程简介知道对方。
3:进程直接知道对方。
竞争合作合作8:进程中资源的争用——互斥1:临界区:critical sections部分程序进入共享区域1:一次只允许有一个程序在临界区中。
操作系统课程英文词汇
操作系统课程英文词汇Operating System Course English VocabularyIntroductionIn today's rapidly advancing technological world, the study of operating systems holds immense importance. An operating system serves as the backbone of any computer system, managing hardware and software resources efficiently. To fully grasp the concepts and principles associated with operating systems, it is essential to have a strong foundation in the relevant English vocabulary. This article aims to provide a comprehensive list of essential English terms commonly used in the context of operating system courses.1. KernelThe kernel is the core component of an operating system. It acts as an intermediary between hardware and software, managing system resources and providing essential services for the execution of programs.2. ProcessA process refers to a task or program in execution. It includes the program code, associated data, and various execution contexts necessary for its execution. Processes are managed by the operating system and can run concurrently on a computer system.3. ThreadA thread represents a section of a process that can be executed independently. Threads share the same memory space and resources within aprocess, allowing for efficient parallelism and enhanced responsiveness in multitasking environments.4. Memory ManagementMemory management involves the allocation and deallocation of memory resources to different processes and threads. It ensures optimal utilization of memory and prevents conflicts among multiple programs competing for resources.5. File SystemA file system is a method used by the operating system to organize and store data on storage devices such as hard drives and solid-state drives. It provides a structured hierarchy of directories and files, enabling efficient retrieval and storage of information.6. Device DriverA device driver is a software component that allows the operating system to communicate with hardware devices. It provides a standardized interface for controlling and accessing various hardware components, such as printers, keyboards, and network adapters.7. SchedulingScheduling refers to the process of determining the order in which processes or threads are executed on a system's CPU. Various scheduling algorithms, such as round-robin, priority-based, and shortest job first, ensure fair allocation of resources and efficient system performance.8. Virtual MemoryVirtual memory extends the physical memory of a computer system by allowing parts of the operating system or processes to reside in secondary storage, such as hard disks. It provides an illusion of a larger memory space, enabling the execution of more extensive programs.9. DeadlockA deadlock occurs when two or more processes are unable to proceed due to circular dependencies on resources. It can lead to a system-wide stalemate, requiring careful resource allocation and scheduling algorithms to prevent such situations.10. InterruptInterrupts are signals generated by hardware devices or software, causing the operating system to temporarily suspend the execution of a process and handle the event. Interrupt handling ensures timely response to hardware events, such as keyboard input or disk I/O.11. File Allocation MethodsFile allocation methods determine how files are stored on a storage medium. Common methods include contiguous allocation, linked allocation, and indexed allocation. Each method has its advantages and trade-offs concerning storage efficiency and file access time.12. PagingPaging is a memory management technique that divides the physical memory into fixed-size blocks called pages. It allows for efficient memoryallocation and virtual memory usage, reducing fragmentation and enhancing system performance.13. SwappingSwapping involves moving an entire process from main memory to secondary storage and vice versa. It enables the system to free memory resources when necessary, allowing for the execution of more significant processes.14. CachingCaching is a technique used to store frequently accessed data in a cache memory. It helps to improve system performance by reducing the time required to access data from slower storage devices.ConclusionUnderstanding the fundamental concepts and vocabulary associated with operating systems is crucial for students pursuing a course in this field. This comprehensive list of English terms provides a solid foundation for studying operating systems and related topics. Remembering and utilizing these terms will enhance communication, comprehension, and overall learning experience in the exciting world of operating systems.。
操作系统第4章线程
Chapter 4 – Threads, SMP, and MicrokernelsTrue / False Questions:1. T / F – The basic unit of dispatching in an operating system is usually referred toas a thread or lightweight process.操作系统的基本单位调度,通常称为一个轻量级线程或线程ANS: T2. T / F – An example of a system that implements a single process with multiplethreads is MS-DOS.MS-DOS操作系统是一个单一进程具有多线程的例子.ANS: F (Java)3. T / F – In a multithreaded environment, a process is defined as the unit ofresource allocation and a unit of protection.ANS: T4. T / F – The concept of thread synchronization is required in multithreadedsystems because threads of a single process share the process’s process control block (PCB).线程同步的概念是一个多线程系统所必需的,因为单一进程的线程共享进程的进程控制块(PCB). F(因为他们有着相同地址空间)ANS: F (because they share the same address space)5. T / F – In a pure User-Level Thread (ULT) facility, all of the work of threadmanagement is done by the application, but the kernel is aware of the existence of threads.在纯用户级线程(ULT)设备中,所有线程管理的工作都是由应用程序负责、但内核知道他们的存在.F(内核是不知道线程的存在)ANS: F (kernel is not aware of the threads existence)6. T / F – 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.ANS: T7. T / F – One disadvantage to the master/slave shared-memory multiprocessorarchitecture is that the failure of the master brings down the whole system.ANS: T8. T / F – In a symmetric multiprocessing (SMP) system, each processor hasaccess only to a private main memory area.在对称多处理系统(SMP)中,每个处理器进入到各自独立的内存领域.F (还获得了内存共享)ANS: F (also have access to a shared main memory)9. T / F – An SMP O/S manages processor and other resources so that the usermay view the system in the same fashion as a multiprogramming uniprocessorsystem.ANS: T10. T / F – The primary advantage of the basic microkernel design over layeredkernel designs involves increased performance.(性能)内核层设计的基本微内核的主要的优点包括提高性能.F(性能降低)ANS: F (performance is a disadvantage)11. T / F – The philosophy underlying the microkernel is that only absolutelyessential core operating system functions should be in the kernel.ANS: T12. T / F – The basic form of communication between processes or threads in amicrokernel O/S is messages.ANS: T13. T / F – Linux makes no distinction between a process and a thread.ANS: T14. T / F – Windows 2000 is an object-oriented O/S, but only processes (not threads)are implemented as objects in the WIN2K O/S.Windows 2000是一个面向对象的操作系统,但在WIN2K系统中只有进程(非线程)是执行的对象ANS: F (threads are also implemented as objects)15. T / F – In the Solaris O/S, a User-Level Thread (ULT) in the active state isassigned to a Light-Weight Process (LWP) and executes while the underlyingkernel thread executes.ANS: TMultiple Choice Questions:1. The concept of a process in an operating system embodies two primarycharacteristics, one of which is:操作系统中进程的概念,体现了两个主要特点的,其中之一是a. Multithreadingb. Resource ownershipc. Symmetric multiprocessingd. None of the aboveANS: B2. An example of a system that implements a single process with multiple threads is:a. WIN 2000b. Solarisc. Javad. All of the aboveANS: C3. Which of the following is true regarding the relationship between processes andthreads:a. It takes far less time to create a new thread in an existing process than tocreate a new process在现有的进程下创建线程要比建一个新进程下创建线程花的时间要少得多b. It takes less time to terminate a process than a threadc. It takes less time to switch between two different processes than to switchbetween two threads within the same processd. All of the aboveANS: A4. The basic thread operation related to the change in thread state that occurswhen a thread needs to wait for an event is referred to as the:线程基本状态发生变化,需要等待一个事件时称为a. Unblock operationb. Spawn operationc. Block operation 阻塞状态d. None of the aboveANS: C5. One of the disadvantages of User-Level Threads (ULTs) compared to Kernel-Level Threads (KLTs) is:a. Scheduling is application specificb. When a ULT executes a system call, all threads in the process areblocked 当一个ULT执行一个系统调用,进程中所有的线程都被阻塞c. Thread switching does not require kernel mode privilegesd. All of the aboveANS: B6. In the Linux O/S, multiple threads may be created and executed within a singleprocess. This is an example of the following Thread-to-Process relationship:a. 1:1b. 1:Mc. M:Nd. None of the aboveANS: D (M:1)7. The computer system category where a single processor executes a singleinstruction stream to operate on data stored in a single memory is called:a. Single Instruction Single Data (SISD) stream 单指令单数据(SISD)流b. Single Instruction Multiple Data (SIMD) streamc. Multiple Instruction Single Data (MISD) streamd. None of the aboveANS: A8. In a SMP system, each processor maintains a local cache and must alert allother processors that a change to cache update has taken place. This is referred to as the:a. Interconnection mechanism problemb. Synchronization mechanism problemc. Cache coherency problem高速缓存一致d. None of the aboveANS: C9. Key issues involved in the design of multiprocessor operating systems include:设计多处理机操作系统的关键问题包括a. Schedulingb. Synchronizationc. Reliability and fault toleranced. All of the aboveANS: D10. Early operating systems that were designed with little concern about structureare typically referred to as:a. Monolithic operating systems 单片机操作系统b. Layered operating systemsc. Kernel operating systemsd. All of the aboveANS: A11. A benefit of the microkernel organization is:a. Extensibilityb. Portabilityc. Flexibilityd. All of the aboveANS: D12. In low-level microkernel memory management, an example of an operation thatcan support external paging and virtual memory management is the:a. Grant operationb. Map operationc. Flush operationd. All of the aboveANS: D13. In a W2K system, the state that a thread enters when it has been unblocked andthe resource for which it has been blocked is not yet available is called the:a. Transition stateb. Waiting statec. Standby stated. None of the aboveANS: A14. In a Solaris system, a User-Level Thread (ULT) that enters the active state isassigned to a:a. Kernel threadb. Heavy-Weight Process (HWP)c. Light-Weight Process (LWP)d. None of the aboveANS: C15. In a Linux system, when a new process is cloned, the two processes share thesame:a. Process identifierb. Virtual memoryc. task_struct data structured. All of the aboveANS: BFill-In-The-Blank Questions: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.ANS: thread or lightweight process2. An example of an operating system that supports a single user process and asingle thread is _______________.ANS: MS-DOS3. An example of an operating system that supports multiple user processes andmultiple threads is _______________.ANS: WIN2K/Solaris/Linux/Mach/OS24. It is necessary to ___________________ the activities of various threads so theydo not interfere with each other or corrupt data structures.ANS: synchronize5. A process that cannot execute until some event occurs is said to be in the_______________ state.ANS: blocked6. The Clouds O/S implements the concept of a thread as primarily an entity thatcan move among address spaces which represents the _______ Thread-to-Process relationship.ANS: One-to-Many7. In a ________________ system, the kernel can execute on any processor, andtypically each processor does self-scheduling from the pool of availableprocesses or threads.ANS: symmetric multiprocessor8. In most modern computer systems, processors generally have at least one levelof __________________ that is private to the processor.ANS: cache memory9. With multiple active processes in an SMP system having potential access toshared address space or shared I/O resources, care must be taken to provide effective _________________.ANS: synchronization10. In the ________________ O/S architecture, functions are organizedhierarchically and interaction only takes place between adjacent sections.ANS: layered11. 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.ANS: extensibility12. The basic form of communication between processes or threads in amicrokernel O/S is __________________ .ANS: messages13. In a Linux system, if the process has been terminated but, for some reason, stillmust have its task structure in the process table is in the _____________ state.ANS: zombie14. In a Solaris system, a User-Level Thread (ULT) in the active state is assigned toa(n) ____________________, and executes while the underlying kernel thread executes.ANS: light-weight process (LWP)15. In a Windows 2000 system, a process that has been selected to run next on aparticular process moves from the Ready state to the _____________ state.ANS: Standby。
操作系统概念(英文)——Syllabus for Operating Systems
Beijing University of Posts and Telecommunications (BUPT)School of Computer Science and TechnologySyllabus for Operating Systems1. OverviewsCourse No.: 313.04103 Course Title: Operating Systems Course Credit: 4 Credits, required courseSemester and Year: Fall 2008 Class: 06406—06410 Teaching hours:z Class teaching: 64 hoursz After-class experiments: 17 hoursz Course design, or professional practice for this course:(操作系统综合课程设计), 30 hours, 1 credits, conducted inthe 3rd semester.Prerequisites:z Data Structurez Computer Organization Principles2. Lecture MeetingsTime: Monday AM: 10:00 – 12:00Wensday AM: 10:00 – 12:00Location: Room 402, 4th Teaching Building3. FacultyInstructorz Name: Dr. Wen YE (叶文)z Office: Room 918, 3rd Teaching Buildingz Office Hours: Wednesday 3:00 to 4:30 PM,I am also available by appointment at a time more convenientfor you, especially at the end of this semesterz Phone: 86-10-62282633 (O)z E-mail: gryew@, yewen@Graduate Teaching Assistant:z Name: Cheng Yan (成艳),chengy352@Ma Haiying(马海印),mahaiyinmhy@ z Responsibility: checking homework, directing experimentsz Office: Room 918, 3rd Teaching Buildingz Office Hours: Wednesday 3:00 to 4:30 PM, or by appointment 4. Text Book1. Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, Operating System Concepts(Seventh Edition), Higher Education Press and McGraw-Hill Companies, Beijing, May, 2007.References1.Andrew S.Tanenbaum, Modern Operating Systems, ChinaMachine Press and Prentice Hall, Beijing, Jan.1999.2.孙钟秀,费翔林,洛斌,谢立,操作系统教程(第3版),高等教育出版社,北京,2003年8月3.曹聪, 范廉明,操作系统原理与分析,科学出版社,北京,2003年9月。
进程和线程中英文
进程和线程简介(中英文)Programs consist of a number of processes, each of which contains one or more conceptually concurrent threads of execution.程序包含了若干进程,每一个进程包含了一个或多个概念上知执行的线程。
A thread is the unit of execution within a process. Every time a process is initialised, a primary thread is created. For many applications the primary thread is the only one that the application requires; however, processes can create additional threads.线程是进程的执行单元。
当进程被初始化后,主线程就被创建了。
对于绝大多数的应用程序来说,通常仅要求有一个主线程。
尽管如此进程也可以创建额外的线程。
Each user process has its own private address space, i.e. a collection of memory regions which that process can access. A user process cannot directly address memory areas in the address space of another process. There is also a special process, the Kernel process, whose threads run at supervisor privilege level. This process normally contains two threads:每一个用户进程拥有自己私有的地址空间,也就是说,进程拥有一定的可被其访问的内存区域。
操作系统概念(英文)
Process Concept (cont.)
3.1.5 Process vs program dynamic vs static process: lifecycle being created —— executing —— being deleted composition: program + data + PCB A program may correspond to several processes; a process may also contains several programs (e.g. main routines, subroutines and procedures )
The process is characterized with dynamic and concurrent features Roles of processes unit of running entity in system, i.e., CPU allocation unit of resource (e.g. memory, files, devices,…) allocation
3.1.2 Process Definition A process is a program in execution the unit of resources (CPU, memory, I/O devices) allocation runs concurrently with other processes
October 2012
Operating System Concepts- Chapter3 Processes -
19
§3.2 Process Scheduling
Android UI线程和非UI线程 2
Android UI线程和非UI线程当应用启动,系统会创建一个主线程(main thread)。
这个主线程负责向UI组件分发事件(包括绘制事件),也是在这个主线程里,你的应用和Android的UI组件发生交互。
所以main thread 也叫UI thread也即UI线程。
AD:UI线程及Android的单线程模型原则当应用启动,系统会创建一个主线程(main thread)。
这个主线程负责向UI组件分发事件(包括绘制事件),也是在这个主线程里,你的应用和Android 的UI组件(components from the Android UI toolkit (components from theandroid.widgetandandroid.viewpackages))发生交互。
所以main thread也叫UI thread也即UI线程。
系统不会为每个组件单独创建线程,在同一个进程里的UI组件都会在UI线程里实例化,系统对每一个组件的调用都从UI线程分发出去。
结果就是,响应系统回调的方法(比如响应用户动作的onKeyDown()和各种生命周期回调)永远都是在UI线程里运行。
当App做一些比较重(intensive)的工作的时候,除非你合理地实现,否则单线程模型的performance会很poor。
特别的是,如果所有的工作都在高山茶 UI线程,做一些比较耗时的工作比如访问网络或者数据库查询,都会阻塞UI线程,导致事件停止分发(包括绘制事件)。
对于用户来说,应用看起来像是卡住了,更坏的情况是,如果UI线程blocked的时间太长(大约超过5秒),用户就会看到ANR(application not responding)的对话框。
另外,Andoid UI toolkit并不是线程安全的,所以你不能从非UI线程来操纵UI组件。
你必须把所有的UI操作放在UI线程里,所以Android的单线程模型有两条原则:1.不要阻塞UI线程。
Chapter-02
Process State 进程状态
• As a process executes, it changes state 进程执行时,改变状态 – new: The process is being created. 新建:在创建进程 – running: Instructions are being executed. 运行:指令在执行 – waiting: The process is waiting for some event to occur. 等待:进程等待某些事件发生 – ready: The process is waiting to be assigned to a processor. 就绪:进程等待分配处理器 – terminated: The process has finished execution. 终止:进程执行完毕
16
CPU Switch From Process to Process 进程间CPU的切换
17
Context Switch
• When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process. • Context represented in PCB of a process,include -CPU registers -process state -memory-management information • Context-switch time is overhead; the system does no useful work while switching. • Time dependent on hardware support.
IBM Cognos Transformer V11.0 用户指南说明书
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
15Biblioteka Transitions between these states
16
进程基本状态的转换
时间片 用完
运行
进程 调度 I/O完成或等待 的事件完成
进程状态之 请求I/O或 等待某事件 间的转换:
就绪
阻塞
就绪→运行 运行→就绪 运行→阻塞 阻塞→就绪
17
2.1.6 Implementation of processes
2
2.1 Processes 2.1.1 The process model 2.1.2 process creation 2.1.3 process termination 2.1.4 Process hierarchies 2.1.5 Process state 2.1.6 Implementation of processes 2.1.7 Modeling multiprogramming
13
example
How does UNIX initialize itself when it is started? A special process, called init, is present in the boot image. When it starts running, it reads a file telling how many terminals there are. Then it forks off one new process per terminal. These processes wait for someone to log in. If a login is successful, the login process executes a shell to accept commands. These commands may start up more processes, and so forth. Thus, all the processes in the whole system belong to a single tree, with init at the root.
10
process creation In windows, in contrast, a single Win32 function call, CreatProcess, handles both process creation and loading the correct program into the new process.
6
进程的定义
进程的参考定义有如下几种: 1、进程是程序的一次执行过程; 2、进程是一个可拥有资源的独立实体,同 时又是一个可以独立调度的基本单位。 3、进程是程序在一个数据集合上运行的过 程,它是系统进行资源分配和调度的一个 独立单位。
7
进程与程序的区别
进程是一个动态的概念,而程序是一个静态的概 念 进程具有并发性 独立性:进程是能独立运行、独立分配资源和接 受调度的基本单位 异步性:进程各自独立的、按不可预知的速度向 前推进 一个进程可以包含多个程序;一个程序也可以对 应多个进程 进程=程序+数据+PCB ,即进程是一个程序及 其数据在处理机上顺序地执行时所发生的活动 进程具有创建其他进程的功能
18
Some of the fields of a typical PCB
19
进程控制块(PCB) 进程=程序+数据+PCB 当创建进程时,为之建立PCB ;当撤消进 程时, PCB也随之撤消。 因此, PCB是进程存在的唯一标志,是系 统感知进程的唯一实体。 PCB 中记录了OS所需的、用于描述进程的 当前情况以及控制进程运行的全部信息。 PCB应常驻内存。
To implement the process model, the OS maintains a table, called the process table, with one entry per process. some authors call these entries process control blocks (PCB, 进程控制块). PCB contains important information about the process’ state, including its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information, and everything else about the process that must be saved when the process is switched from running to ready or blocked state.
11
2.1.3 process termination Due to one of the following conditions, the process will terminate.
Normal exit (voluntary) Error exit (voluntary) Fatal error (involuntary) Killed by another process (involuntary)
8
2.1.2 process creation In general-purpose systems, some way is needed to create and terminate processes as needed during operation. There are 4 principal events that cause processes to be created:
14
2.1.5 Process state The three states of a process:
Running(运行状态): actually using the CPU at that instant Ready(就绪状态): runnable; temporarily stopped to let another process run Blocked(阻塞状态): unable to run until some external event happens
12
2.1.4 Process hierarchies In some systems, when a process creates another process, the parent process and child process continue to be associated in certain ways. The child process can itself create more processes, forming a process hierarchy. In UNIX, a process and all of its children and further descendants together form a process group.
Principles of Operating System
Chapter 2 Processes and threads
Contents 2.1 Processes 2.2 Interprocess communication (IPC) 2.3 Classical IPC problems 2.4 Threads 2.5 Scheduling
System initialization Execution of a process creation system call by a running process A user request to create a new process Initiation of a batch job
3
2.1.1 The process model All the runnable software on the computer, sometimes including the OS, is organized into a number of sequential processes, or just processes for short. A process is just an instance of an executing program, including the current values of the program counter, registers, and variables.
4
Example
(a) Multiprogramming of four programs
(b)Conceptual model of four independent, sequential processes
(c) Only one program is active at once
5
A process is an activity of some kind. It has a program, input, output, and a state. A single processor may be shared among several processes, with some scheduling algorithm being used to determine when to stop work on one process and service a different one.
20
2.1.7 Modeling multiprogramming
When multiprogramming is used, the CPU utilization can be improved. A better model is to look at CPU usage from a probabilistic viewpoint. Suppose that a process spends a fraction p of its time waiting for I/O to complete. When n processes in memory at once, the probability that all n processes are waiting for I/O is pn. The CPU utilization is 1- pn.