Download
process n.
Skip this Video
Loading SlideShow in 5 Seconds..
Process PowerPoint Presentation

Process

156 Vues Download Presentation
Télécharger la présentation

Process

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Process Additional references: Operating Systems: Internals and Design Principles 5e– William Stallings - Pearson This lecture slide uses images/slides from other references also.

  2. Free memory User task Monitor / Kernel Single tasking • Life is simple here • Have only one task running • Task directly loaded • What will you do to execute such a task? • What if more than one process?

  3. Linux process’ run-time memory • Process • Code • Data part Fig courtesy: Computer Systems: a programmer’s perspective

  4. Process • Program has just code  NOT Live entity • Process with data, work-space • Stack • Heap • Open files • File descriptors • Other primitives • ipc, memory, … • Execution snapshots • Register content • Program counter • General purpose registers

  5. Question??? • How are multiple processes handled? • How does process management take place? • Creation, deletion,… • What to do when a process performs I/O? • How to ensure all processes get a chance to execute? • Can processes communicate among one another? • If so, how? • What are the desirable features?

  6. Example Execution

  7. A simple scenario: Two-State Process Model • Process may be in one of two states • Running • Not-running

  8. Both are 2 different scenarios Not-Running Process in a Queue What processes are in queue? Process timed out Process gone for I/O

  9. Process (contd.) • Not-running • Ready to run given chance • Blocked/waiting for event • Why not three states then?

  10. Dispatch Admit Release Ready Running Time out Event Occurs Event Wait Blocked Three state model

  11. Three state model Queuing Diagram

  12. Multiple Blocked Queues

  13. Dispatch Admit Release New Ready Running Time out Event Occurs Event Wait Blocked Four state model • Need to create process • Process control block • Verify availability of resources What about termination?

  14. Dispatch Admit Exit Terminate New Ready Running Time out Event Occurs Event Wait Blocked Five state model • Terminate • To wrap up process • Wait conditions before termination

  15. Process States

  16. Suspended Processes • Processor is faster than I/O so all processes could be waiting for I/O • Swap these processes to disk to free up more memory • Blocked state becomes suspend state when swapped to disk

  17. One Suspend State (6 state model) • Suspend does not show those that can run once in memory • Two new states • Blocked/Suspend • Ready/Suspend