CS3224 - 2. Processes

CS3224 - 2. Processes - Processes What are they? How do we...

Info iconThis preview shows pages 1–10. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Processes • What are they? How do we represent them? • Scheduling • Something smaller than a process? Threads • Synchronizing and Communicating • Classic IPC problems Processes The Process Model a) Multiprogramming of four processes b) Conceptual model of 4 independent, sequential processes c) Only one process active at any instant on each processor. From Tanenbaum’s Modern Operating System
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Process Life Cyle • Processes are “created” • They run for a while • They wait • They run for a while… • They die Process States From Tanenbaum’s Modern Operating System
Background image of page 2
3 NT States Picture from Inside Windows 2000 So what’s a Process? • What from the OS point of view, is a process? • A struct. Sitting on a batch of queues.
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 Implementation of Processes Fields of a process table entry From Tanenbaum’s Modern Operating System Process Creation Principal events that cause process creation A. System start-up B. Started from a GUI C. Started from a command line D. Started by another process
Background image of page 4
5 Process Termination Conditions which terminate processes 1. Normal exit (voluntary) 2. Error exit (voluntary) 3. Fatal error (involuntary) 4. Killed by another process (involuntary) From Tanenbaum’s Modern Operating System Process Hierarchies • A Process can creates one (or more) child process. • Each child can create its own children. • Forms a hierarchy through ancestry • Parents have control of their children • NT processes can give away their children.
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Switching from Running one Process to another • Known as a “Context Switch” • Requires – Saving and loading registers – Saving and loading memory maps – Updating Ready List – Flushing and reloading the memory caches –Etc. Handling Interrupts Who does what?
Background image of page 6
7 Need for Multiprogrammng • How many processes does the computer need in order to stay “busy”? Threads Overview • Usage • Model • Implementation • Conversions
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 Thread Usage • Makes it easier to write programs that have to be ready to do more than one thing at a time using the same data. Thread Model • A process consists of – Open files – Memory management – Code – Global data – Call Stack (includes local data) – Hardware Context: • Instruction pointer , stack pointer, general registers
Background image of page 8
9 Thread Model (continued) • Each thread has its own – Stack (includes local variables) – Program counter – General registers (copies) • A process can have many threads Thread Implementations User level thread package • Implemented as a library in user mode – Includes code for creating, destroying, switching… • Often faster for thread creation, destruction and switching • Doesn’t require modification of the OS • If one thread in a process blocks then the whole process blocks.
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/02/2010 for the course CS 3224 taught by Professor Johnsterling during the Spring '10 term at NYU Poly.

Page1 / 41

CS3224 - 2. Processes - Processes What are they? How do we...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online