Chico CSCI 340 - Chapter 3: Processes modified by your instructor

Unformatted text preview:

Chapter 3: Processes modified by your instructorChapter 3: ProcessesIntroductory Remarks – Quick Review Concepts SlideProcess ConceptProcess in MemoryProcess StateDiagram of Process StateProcess Control Block (PCB)Slide 9CPU Switch From Process to ProcessProcess Scheduling QueuesSlide 12Observe the Structure of the PCB in LinuxReady Queue And Various I/O Device QueuesRepresentation of Process SchedulingSchedulersSchedulerSchedulers (Cont.)More on SchedulersContext SwitchShells and the KernelKernelKernel SubsystemsKernel Subsystems – a view of files and I/O…Slide 25Talking to the KernelVisual on Talking to the KernelShellsSlide 29Bourne ShellShells – last for nowEnd of Chapter 3.1Chapter 3: ProcessesChapter 3: Processesmodified by your instructormodified by your instructor3.2Silberschatz, Galvin and Gagne ©2005Operating System ConceptsChapter 3: ProcessesChapter 3: ProcessesProcess ConceptProcess SchedulingOperations on ProcessesCooperating ProcessesInterprocess CommunicationCommunication in Client-Server SystemsThis is a very important chapter now that we have completed the introductory materials.This will require two to three lectures.3.3Silberschatz, Galvin and Gagne ©2005Operating System ConceptsIntroductory Remarks – Introductory Remarks – Quick Review Concepts SlideQuick Review Concepts SlideWe speak of programs and processes. It is important to distinguish between the two.A process is a program in execution; a unit of work.Programs are files stored somewhere – static and passiveA process is executing and needs resources from the computing system such asCPU cyclesMemoryFilesI/O devices.But the operating system is responsible for executing processes and all management of overall resources and those related to processes:Creation / deletion of user and system processes (user code, system code).Process schedulingSynchronization of processes, communication among processes, and the handling of deadlock conditions that can occur among processes.3.4Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess ConceptProcess ConceptAn operating system executes a variety of programs:Batch system – jobsThese usually run from beginning to endTime-shared systems – user programs or tasksEspecially interactive tasking…Textbook uses terms job and process almost interchangeably (for some systems, this is okay, but not all!)Process – a program in executionA process includes:program counter (contained in a CPU register)Current register settingsStack (will see its use ahead)data section – global variables3.5Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess in MemoryProcess in MemoryText – the object code instructionsProgram Counter – address of the next instructionto be fetched from memory, brought intothe CPU, decoded, and executedRegister settings – current values of working registersStack – temporary area for program parameters,return addresses, stack frames (used forrecursion) local variables (specific method)Data – global variables; other data; buffersHeap – (optional) hunk of memory that may be madeavailable for dynamic storage allocation likefor creation of objects and moreWe usually refer to all this as a processes ‘address space.’3.6Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess StateProcess StateAs any process executes, it changes state.All processes have ‘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 processterminated: The process has finished executionEven when a process is running, it’s ‘internal’ state is changing! (values of its variables, etc.)3.7Silberschatz, Galvin and Gagne ©2005Operating System ConceptsDiagram of Process StateDiagram of Process StateImportant to note that at any given instant in time, a CPU can only be executing a single instruction from a user or operating system process.Other processes are in other ‘states’ like waiting or ready, or …Discuss states and their transitions3.8Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess Control Block (PCB)Process Control Block (PCB)Every process has a PCB – an abstraction of the process itself. Some vendors call PCBs task control blocks (IBM, for example)The PCB is a data structure used to manage the process.It contains: (shown on next slide) everything needed to ‘represent’ the process.Process state – ready, waiting, running, etc.Program counter – address of next instructionCPU registers – instruction registers, stack pointers, index registers, condition-code and/or flag registers….CPU scheduling information – scheduling priorities; specific ‘queues’Memory-management informationBase / limit registers; page tables; segment tables – these depend upon the memory management scheme usedAccounting information – amount of CPU time; memory used, account numbers, time limits, … other resource computations used…I/O status information – list of I/O devices allocated to the process; list of open files, their status, etc.3.9Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess Control Block (PCB)Process Control Block (PCB)When a process changes state, say from Running to Wait, the values / contents of the CPU’s registers, instruction counter, etc. are copied into this abstraction of the process to provide for resumption later.All processes have a PCB to represent them and the resources, constraints, temporary values, etc. associated with the process they represent.Used to manage the process – resumption of processing, protection of areas of memory, accounting info and much more.3.10Silberschatz, Galvin and Gagne ©2005Operating System ConceptsCPU Switch From Process to ProcessCPU Switch From Process to ProcessDiscuss “ContextSwitching!”Originating outside or within the process.Note: Or some other Ready process!3.11Silberschatz, Galvin and Gagne ©2005Operating System ConceptsProcess Scheduling QueuesProcess Scheduling QueuesRemember: goal of what we call multiprogramming is to have some process running all the time to maximize CPU utilization;Goal of time sharing is to switch the context from one process to another so users can


View Full Document

Chico CSCI 340 - Chapter 3: Processes modified by your instructor

Download Chapter 3: Processes modified by your instructor
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 Chapter 3: Processes modified by your instructor 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 Chapter 3: Processes modified by your instructor 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?