Posts

Showing posts from 2015

Summary of Process Concepts

Summary A process, which is a program in execution, is central to understanding how today’s computer systems perform and keep track of many simultaneous activities. Each process has its own address space, which may consist of a text region, data region and stack region. A process moves through a series of discrete process states. For example, a process can be in the running state, ready state or blocked state. The ready list and blocked list store references to processes that are not running . When a process reaches the head of the ready list, and when a processor becomes available, that process is given the processor and is said to make a transition from the ready state to the running state. The act of assigning a processor to the first process on the ready list is called dis- patching. To prevent any one process from monopolizing the system, either accidentally or maliciously, the operating system sets a hardware interrupting clock (or interval timer) to allow a process to run f...

Process Concepts:Case Study,UNIX Processes

Image
Case Study: UNIX Processes UNIX and UNIX-based operating systems provide an implementation of processes that has been borrowed by many other operating systems (see the Mini Case Study, UNIX Systems). In this section, we describe the structure of UNIX processes, discuss several UNIX features that motivate the discussion in the following chapters and introduce how UNIX allows users to perform process management operations. Each process must store its code, data and stack in memory during execution. In a real memory system, processes would locate such information by referencing a range of physical addresses. The range of valid main memory addresses for each process is determined by the size of main memory and the memory consumed by other processes. Because UNIX implements virtual memory, all UNIX processes are provided with a set of memory addresses, called a virtual address space , in which the process may store information. The virtual address space contains a text region, data regi...

Process Concepts:Interprocess Communication

Interprocess Communication In multiprogrammed and networked environments, it is common for processes to communicate with one another. Many operating systems provide mechanisms for interprocess communication (IPC) that, for example, enable a text editor to send a document to a print spooler or a Web browser to retrieve data from a distant server. Interprocess communication is also essential for processes that must coordinate (i.e., synchronize) activities to achieve a common goal. The case studies on Linux (see Section 20.10, Interprocess Communication) and Windows XP (see Section 21.10, Interprocess Communication) discuss how IPC is implemented in popular operating systems. Signals Signals are software interrupts that notify a process that an event has occurred. Unlike other IPC mechanisms we discuss, signals do not allow processes to specify data to exchange with other processes.28 A system’s signals depend on the operating system and the software-generated interrupts supported ...

Process Concepts:Interrupts

Image
Interrupts As discussed in Chapter 2, Hardware and Software Concepts, interrupts enable software to respond to signals from hardware. The operating system may specify a set of instructions, called an interrupt handler , to be executed in response to each type of interrupt. This allows the operating system to gain control of the processor to manage system resources. A processor may generate an interrupt as a result of executing a process’s instructions (in which case it is often called a trap and is said to be synchronous with the operation of the process). For example, synchronous interrupts occur when a process attempts to perform an illegal action, such as dividing by zero or referencing a protected memory location. Interrupts may also be caused by some event that is unrelated to a process’s current instruction (in which case they are said to be asynchronous with process execution; see the Operating Systems Thinking feature, Asynchronism vs. Synchronism). Hardware devices issue...

Process Concepts:Process Management

Image
Process Management As the operating system interleaves the execution of its processes, it must carefully manage them to ensure that no errors occur as the processes are interrupted and resumed. Processes should be able to communicate with the operating system to perform simple tasks such as starting a new process or signaling the end of process execution. In this section, we discuss how operating systems provide certain fundamental services to processes—these include creating processes, destroying processes, suspending processes, resuming processes, changing a process’s priority, blocking processes, waking up processes, dispatching processes, enabling processes to interact via interprocess communication (IPC) and more. We also discuss how operating systems manage process resources to allow multiple processes to actively contend for processor time at once. Process States and State Transitions When a user runs a program, processes are created and inserted into the ready list. A pro...

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...

Hardware and Software Concepts:Compiling, Linking and Loading

Image
Compiling, Linking and Loading Before a program written in a high-level language can execute, it must be translated into machine language, linked with various other machine-language programs on which it depends and loaded into memory. In this section we consider how pro- grams written in high-level languages are compiled into machine-language code and we describe how linkers and loaders prepare compiled code for execution.40 Compiling Although each type of computer can understand only its own machine language, nearly all programs are written in high-level languages. The first stage in the process of creating executable programs is compiling the high-level programming language code to machine language. A compiler accepts source code , which is written in a high-level language, as input and returns object code , containing the machine-language instructions to execute, as output. Nearly all commercially available pro- grams are delivered as object code, and some distributions (i.e.,...