{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

03-Processes - CSE 421/521 Operating Systems Fall 2011...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 421/521 - Operating Systems Fall 2011 Tevfik Ko ş ar University at Buffalo September 6 th , 2011 Lecture - III Processes 2 Roadmap • Processes Basic Concepts Process Creation Process Termination Context Switching Process Queues Process Scheduling Interprocess Communication Process Concept a Process is a program in execution ; Typical process image implementation Stallings, W. (2004) Operating Systems: Internals and Design Principles (5th Edition). ! A process image consists of three components 1. an executable program 2. the associated data needed by the program 3. the execution context of the process, which contains all information the O/S needs to manage the process (ID, state, CPU registers, stack, etc.) user address space Process Control Block 4 ! The Process Control Block (PCB) Typical process image implementation " is included in the context, along with the stack " is a “snapshot” that contains all necessary and sufficient data to restart a process where it left off (ID, state, CPU registers, etc.) " is one entry in the operating system’s process table (array or linked list) PCB 1 PCB 2 PCB 3 . . . context user address space program code data stack process control block (PCB) Process Control Block 5 Illustrative contents of a process image in (virtual) memory ! Example of process and PCB location in memory O/S process 2 process 1 context program code data program code data stack process control block (PCB) identification program code data stack CPU state info control info stack • numeric identifier • parent identifier • user identifier • etc. • user-visible registers • control & status registers • program counter • stack pointers, etc. • schedulg & state info • links to other proc’s • memory limits • open files • etc. 6 Process State As a process executes, it changes state new : The process is being created ready : The process is waiting to be assigned to a processor running : Instructions are being executed waiting : The process is waiting for some event to occur terminated : The process has finished execution
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Process Creation 7 ! Some events that lead to process creation (enter) " the system boots # when a system is initialized, several background processes or “daemons” are started (email, logon, etc.) " a user requests to run an application # by typing a command in the CLI shell or double-clicking in the GUI shell, the user can launch a new process " an existing process spawns a child process # for example, a server process (print, file) may create a new process for each request it handles # the init daemon waits for user login and spawns a shell " a batch system takes on the next job in line all cases of process spawning Process Creation 8 ! Process creation by spawning Silberschatz, A., Galvin, P. B. and Gagne. G. (2003) Operating Systems Concepts with Java (6th Edition).
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern