Docsity

Understanding OS Processes: Elements, Control Block, States, and Management, Exams of Artificial Intelligence

Partial preview of the text

Download Understanding OS Processes: Elements, Control Block, States, and Management and more Exams Artificial Intelligence in PDF only on Docsity!

Chapter 3

Process Description And Control

Operating Systems: Internals and Design Principles Seventh Edition By William Stallings

Operating Systems: Internals and Design Principles The concept of process is fundamental to the structure of modern computer operating systems. Its evolution in analyzing problems of synchronization, deadlock, and scheduling in operating systems has been a major intellectual contribution of computer science. WHAT CAN BE AUTOMATED?: THE COMPUTER SCIENCE AND ENGINEERING RESEARCH STUDY, MIT Press, 1980

OS Management of Application Execution

  • Resources are made available to multiple applications
  • The processor is switched among multiple applications so all will appear to be progressing
  • The processor and I/O devices can be used efficiently

Process

  • A program in execution
  • An instance of a program running on a computer
  • The entity that can be assigned to and executed on a processor
  • A unit of activity characterized by the execution of a sequence of instructions, a current state, and an associated set of system resources

Process Elements

  • While the program is executing, this process can be uniquely characterized by a number of elements, including: identifier state priority program counter memory pointers context data I/O status information accounting information

Process Control Block

▪Contains the process elements ▪Makes it possible to interrupt a running process and later resume execution as if the interruption had not occurred ▪Created and managed by the operating system ▪Key tool that allows support for multiple processes (multiprogramming)

Process Execution

Traces of

Processes of

Figure 3.

  • Each process

runs to

completion

Two-State Process Model

  • A process may be in one of two states:
    • running
    • not-running

Queuing Diagram

Process Creation

Process

spawning

  • when the

OS creates

a process at

the explicit

request of

another

process

Parent

process

  • is the

original,

creating,

process

Child

process

  • is the new

process

Process Termination

  • There must be a means for a process to indicate its completion
  • A batch job should include a HALT instruction or an explicit OS service call for termination
  • For an interactive application, the action of the user will indicate when the process is completed (e.g. log off, quitting an application)

Five-State Process Model

  • Process States for Trace of Figure 3.