DOC PREVIEW
UB CSE 421 - Process Description and Control

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1/28/02 B.Ramamurthy 1Process Description and ControlB.Ramamurthy1/28/02 B.Ramamurthy 2IntroductionThe fundamental task of any operating system is process management.OS must allocate resources to processes, enable sharing of information, protect resources, and enable synchronization among processes.In many modern OS the problems of process management is compounded by introduction of threads.We will process management in this lecture and threads in the next.1/28/02 B.Ramamurthy 3Topics for discussionRequirement of processProcess statesCreation, termination and suspensionFive State ModelProcess Control Block (PCB)Process controlUnix System VSummary1/28/02 B.Ramamurthy 4What is a process?A process is simply a program in execution: an instance of a program execution.Unit of work individually schedulable by an operating system.OS keeps track of all the active processes and allocates system resources to them according to policies devised to meet design performance objectives.To meet process requirements OS must maintain many data structures efficiently.The process abstraction is a fundamental OS means for management of concurrent program execution. Example: instances of process co-existing.1/28/02 B.Ramamurthy 5Major requirementsOS must interleave the execution of a number of processes to maximize processor use while providing reasonable response time.OS must allocate resources to processes in conformance with a specific policy. Example: (i) higher priority, (ii) avoid deadlock.Support user creation of processes and IPC both of which may aid in the structuring of applications.1/28/02 B.Ramamurthy 6Process creationFour common events that lead to a process creation are:1) When a new batch-job is presented for execution.2) When an interactive user logs in.3) When OS needs to perform an operation (usually IO) on behalf of a user process, concurrently with that process.4) To exploit parallelism an user process can spawn a number of processes.==> concept of parent and child processes.1/28/02 B.Ramamurthy 7Process HierarchiesParent creates a child process, child processes can create its own processForms a hierarchyn UNIX calls this a "process group"Windows has no concept of process hierarchyn all processes are created equal1/28/02 B.Ramamurthy 8Termination of a processNormal completion, time limit exceeded, memory unavailableBounds violation, protection error, arithmetic error, invalid instructionIO failure, Operator intervention, parent termination, parent requestA number of other conditions are possible. Segmentation fault : usually happens when you try write/read into/from a non-existent array/structure/object component. Or access a pointer to a dynamic data before creating it. (new etc.)Bus error: Related to function call and return. You have messed up the stack where the return address or parameters are stored.1/28/02 B.Ramamurthy 9A five-state process modelFive states: New, Ready, Running, Blocked, ExitNew : A process has been created but has not yet been admitted to the pool of executable processes.Ready : Processes that are prepared to run if given an opportunity. That is, they are not waiting on anything except the CPU availability.Running: The process that is currently being executed. (Assume single processor for simplicity.)Blocked : A process that cannot execute until a specified event such as an IO completion occurs.Exit: A process that has been released by OS either after normal termination or after abnormal termination (error).1/28/02 B.Ramamurthy 10State Transition Diagram NEWREADYRUNNINGBLOCKEDEXITAdmitDispatchTime-outReleaseEvent WaitEvent OccursThink of the conditions under which state transitions may take place.1/28/02 B.Ramamurthy 11Queuing modelEvent1 WaitAdmitReady queueDispatchCPUReleaseTime-outEvent1OccursEvent2 WaitEvent2OccursEventn WaitEvent noccurs1/28/02 B.Ramamurthy 12Process TransitionsReady --> Runningn When it is time, the dispatcher selects a new process to runRunning --> Readyn the running process has expired his time slotn the running process gets interrupted because a higher priority process is in the ready state1/28/02 B.Ramamurthy 13Process TransitionsRunning --> Blockedn When a process requests something for which it must waitw a service that the OS is not ready to performw an access to a resource not yet availablew initiates I/O and must wait for the result w waiting for a process to provide input (IPC)Blocked --> Readyn When the event for which it was waiting occurs1/28/02 B.Ramamurthy 14Implementation of Processes Skeleton of what lowest level of OS does when an interrupt occurs1/28/02 B.Ramamurthy 15Operating System Control StructuresAn OS maintains the following tables for managing processes and resources:n Memory tables (see later)n I/O tables (see later)n File tables (see later)n Process tables (this chapter)1/28/02 B.Ramamurthy 16Process descriptionOS constructs and maintains tables of information about each entity that it is managing : memory tables, IO tables, file tables, process tables.Process control block: Associated with each process are a number of attributes used by OS for process control. This collection is known as PCB. For more details on PCB see Figure 2-4.1/28/02 B.Ramamurthy 17Process Table Entry (PCB)Fields of a process table entry1/28/02 B.Ramamurthy 18Process control blockContains three categories of information:1) Process identification2) Process state information3) Process control informationProcess identification: n numeric identifier for the process (pid)n identifier of the parent (ppid)n user identifier (uid) - id of the usr responsible for the process.Process state information: n User visible registersn Control and status registers : PC, IR, PSW, interrupt related bits, execution mode.n Stack pointers1/28/02 B.Ramamurthy 19Process control block (contd.)Process control information:n Scheduling and state information : Process state, priority, scheduling-related info., event awaited.n Data structuring : pointers to other processes (PCBs): belong to the same queue, parent of process, child of process or some other relationship.n Interprocess comm: Various flags, signals, messages may be maintained in PCBs.1/28/02 B.Ramamurthy 20Process control block (contd.)Process control information (contd.)n Process privileges: access privileges to certain memory area, critical structures etc.n Memory management: pointer to the various memory management data structures.n Resource ownership : Pointer to resources such as opened


View Full Document

UB CSE 421 - Process Description and Control

Documents in this Course
Security

Security

28 pages

Threads

Threads

24 pages

Security

Security

20 pages

Security

Security

52 pages

Security

Security

20 pages

Load more
Download Process Description and Control
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Process Description and Control and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Process Description and Control 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?