Process Concepts:Introduction and Process States,Life Cycle of a Process.
Introduction
Many systems in nature have the ability to perform multiple actions at the same time. For example, the human body performs a great variety of operations in parallel—or, as we will say, concurrently. Respiration, blood circulation, thinking, walking and digestion, for example, can occur concurrently, as can the senses—sight, touch, smell, taste and hearing. Computers, too, perform operations concurrently. It is common for desktop computers to be compiling a program, sending a file to a printer, rendering a Web page, playing a digital video clip and receiving e-mail con- currently (see the Operating Systems Thinking feature, Customers Ultimately Want Applications).
In this chapter we formally introduce the notion of a process, which is central to understanding how today’s computer systems perform and keep track of many simultaneous activities. We introduce some of the more popular definitions of process. We present the concept of discrete process states and discuss how and why processes make transitions between these states. We also discuss various operations that operating systems perform to service processes, such as creating, destroying, suspending, resuming and waking up processes.
Definition of Process
The term “process” in the context of operating systems was first used by and the designers of the Multics system in the 1960s (see the Mini Case Study, CTSS and Multics and the Biographical Note, Fernando J. Corbató).1 Since that time, process, used somewhat interchangeably with task, has been given many definitions, such as: a program in execution, an asynchronous activity, the “animated spirit” of a procedure, the “locus of control” of a procedure in execution, that which is manifested by
Operating Systems Thinking
Customers Ultimately Want Applications
Ultimately, computers exist to run useful applications. Operating systems designers can lose sight of this because they tend to be concerned with complex technical issues of operating systems architecture and engineering. But they cannot operate in a void; they must know their user community; the kinds of applications those users will be running and what results the users really want from those applications. Hardware stores sell many tools to help you perform household chores. The tool designer needs to be aware that few people are interested in simply purchasing tools; rather they ultimately buy the tools for the tasks they perform. Customers do not really want saws, hammers and drills—they want cuts, nails in wood and holes.
the existence of a data structure called a “process descriptor” or a “process control block” in the operating system, that entity to which processors are assigned and the “dispatchable” unit. A program is to a process as sheet music is to a symphony orchestra playing the music.
Two key concepts are presented by these definitions. First, a process is an entity. Each process has its own address space, which typically consists of a text region, data region and stack region. The text region stores the code that the processor executes. The data region stores variables and dynamically allocated memory that the process
Mini Case Study
CTSS and Multics
In the early 1960s, a team of programmers at MIT’s Project MAC, led by Professor Fernando Corbató, developed the Compatible Time-Sharing System (CTSS) which allowed users to command the computing power of an IBM 7090 (which eventually became an IBM 7094) with typewriterlike terminals.2, 3 CTSS ran a conventional batch stream to keep the computer working while giving fast responses to interactive users editing and debugging pro- grams. The computing capabilities provided by CTSS resembled those provided to personal computer users today—namely,a highly interactive environment in which the computer gave rapid responses to large numbers of relatively trivial requests.
In 1965 the same MIT group, in cooperation with Bell Labs and GE, began working on the Multics (Multiplexed Information and Computing Service) operating system, the successor to CTSS. Multics was a large and complex system; the designers envisioned a general-purpose computer utility that could be “all things to all people.” Although it did not achieve commercial success, it was used by various research centers until the last system was shut down in 2000.4
A variety of Multics features influenced the development of future operating systems, including UNIX, TSS/360, TENEX and
TOPS-20.5 Multics used a combination of segmentation and paging for its virtual memory system, with paging controlled only by the operating system, while segments were manipulated by user pro- grams as well.6 It was one of the first operating systems to be writ- ten in a high-level systems-programming language, IBM’s PL/I.7, 8 Its designers coined the term “process” as it is currently used in operating systems. Multics was built for security. It included a discretionary access mechanism called ACL (Access Control List), which was a list of permissions on a memory segment which would look familiar to UNIX users. Later versions included a mandatory access control, AIM (Access Isolation Mechanism), an enhancement to ACL where every user and object was assigned a security classification, which helped Multics become the first operating system to get a B2 security rating from the U.S. government.9, 10, 11 In 1976 the first commercial relational database system was written, the Multics Relational Data Store.12
uses during execution. The stack region stores instructions and local variables for active procedure calls. The contents of the stack grow as a process issues nested procedure calls and shrink as called procedures return.13 Second, a process is a “program in execution.” A program is an inanimate entity; only when a processor “breathes life” into a program does it become the active entity we call a process.
Self Review
1. Why is a process’s address space divided into multiple regions?
2. (T/F) The terms “process” and “program” are synonymous.
Ans: 1) Each region of an address space typically contains information that is accessed in a similar way. For example, most processes read and execute instructions, but do not modify their instructions. Processes read from and write to the stack, but in last-in-first-out order. Processes read and write data in any order. Separating a process’s address space into different regions enables the operating system to enforce such access rules. 2) False.A process is a program in execution; a program is an inanimate entity.
Process States: Life Cycle of a Process
The operating system must ensure that each process receives a sufficient amount of processor time. For any system, there can be only as many truly concurrently executing processes as there are processors. Normally, there are many more processes
Biographical Note
Fernando J. Corbató
Fernando Jose Corbató received his Ph.D. in Physics from MIT in 1956. Corbató was a professor at MIT from 1965 to 1996, retiring as a Professor Emeritus in the Department of Electrical Engineering and Computer Science.14 He was a founding member of MIT’s Project MAC and led the development of the CTSS and Multics project.15, 16 He coauthored technical papers on Multics and on the project management issues of that large cooperation among MIT Project MAC, General Electric, and Bell Labs.
Corbató received the 1990 Turing Award for his work on CTSS and Multics.17 His award lecture was “On Building Systems
That Will Fail,” in which he describes how the intrinsic complexity of large and innovative projects will always lead to mistakes, drawing largely from his Multics experiences. In his lecture he advised developers to assume that any given error will occur and that they should therefore plan how to handle it.18 than processors in a system. Thus, at any given time, some processes can execute and some cannot.
During its lifetime,a process moves through a series of discrete process states. Various events can cause a process to change state.A process is said to be running (i.e., in the running state) if it is executing on a processor.A process is said to be ready (i.e., in the ready state) if it could execute on a processor if one were available.A pro- cess is said to be blocked (i.e., in the blocked state) if it is waiting for some event to happen (such as an I/O completion event, for example) before it can proceed. There are other process states, but for now we will concentrate on these three.
For simplicity, let us consider a uniprocessor system, although the extension to multiprocessing (see Chapter 15, Multiprocessor Management) is not difficult. In a uniprocessor system only one process may be running at a time, but several may be ready and several blocked. The operating system maintains a ready list of ready processes and a blocked list of blocked processes. The ready list is maintained in priority order, so that the next process to receive a processor is the first one in the list (i.e., the process with the highest priority). The blocked list is typically unordered— processes do not become unblocked (i.e., ready) in priority order; rather, they unblock in the order in which the events they are waiting for occur. As we will see later, there are situations in which several processes may block awaiting the same event; in these cases it is common to prioritize the waiting processes.
Self Review
1. (T/F) At any given time, only one process can be executing instructions on a computer.
2. A process enters the blocked state when it is waiting for an event to occur. Name several events that might cause a process to enter the blocked state.
Ans: 1) False. On a multiprocessor computer, there can be as many processes executing instructions as there are processors. 2) A process may enter the blocked state if it issues a request for data located on a high-latency device such as a hard disk or requests a resource that is allocated to another process and is currently unavailable (e.g., a printer). A process may also block until an event occurs, such as a user pressing a key or moving a mouse.
Comments
Post a Comment