1 / 20

CS134: October 15, 2001

CS134: October 15, 2001. Process control and scheduling Process Control Block Resource Control Block Scheduling. Context. The kernel is a set of primitive operations and processes A “primitive operation” is a subroutine that is part of the calling process (often a critical section)

kerem
Télécharger la présentation

CS134: October 15, 2001

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS134: October 15, 2001 • Process control and scheduling • Process Control Block • Resource Control Block • Scheduling Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  2. Context • The kernel is a set of primitive operations and processes • A “primitive operation” is a subroutine that is part of the calling process (often a critical section) • A process requesting a service from another sends a request message, and (usually) blocks until the service is performed • The service process (usually) blocks until it receives a request Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  3. Kernel operation classes • Primitives for process creation, destruction, and basic interprocess communication • Primitives for allocating and releasing resources (such as memory, storage, IO devices, files...) • Input and output primitives • Operations to handle interrupts Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  4. Process Creation Hierarchy Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  5. Process state diagram Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  6. Process Control Block Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  7. Identification • Identification: each process is uniquely identified by a pointer to its process control block; it also has some other description (a string or number) that identifies it. The kernel provides a function ID -> *PCB Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  8. State Vector • State: information required by the processor to run the process. Modified by execution of the process, or other processes that share the state vector • CPU state: process capabilities and protection info (and PC and register contents when blocked). Usually defined by processor architecture • Processor: set to processor number when executing (undefined otherwise) • Memory: storage map (page or segment table with VM), shared or owned • Resources: allocated resources (resource class + unit description) Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  9. Status Information • Status: • running: the process in running on the processor Processor • ready: the process is ready to run, waiting for a processor • blocked: the process can’t proceed until it receives a resource or a message • In addition, the status may allow a suspended state (^Z) • The status data is a pointer to the a job queue (ready or waiting) Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  10. Other • Process hierarchy • Parent pointer (the root process will be null) • Linked list of children • Other • Priority • Policy info • ... Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  11. Linux PCB (struct task_struct) Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  12. Linux PCB Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  13. Linux ID Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  14. Linux State Vector Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  15. Linux Other Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  16. Resource Descriptors • Resources include hardware components, as well as software components that satisfy the definitions of resources: • An inventory: listing the number and id of available units • A waiting list of blocked process with unsatisfied requests for the resource • An allocator responsible for deciding which requests should be honored and when • Hardware resources: drives, I/O devices, ... • Software resources: message queues, buffers, IRQs, ... Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  17. Resource descriptor Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  18. Resource components • Inventory list avail: a list of units (hardware devices, buffers, etc) • Waiting process list waiters: linked list of waiting processes with details about the type of request and allocation (result) area • Allocator: matches available resources with requests of waiting processes Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  19. The processor resource • Processors are a special kind of resource: • Processes are not “blocked” when they are waiting for a processor; they are “ready” • Processes wait on a “ready list” RL: which is the Waiters for the processor resource • The ready-list is a priority queue Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

  20. Queues • A queue supports two operations • insert(q, p): adds process p to queue q • remove(q): deletes and returns an element of the q • FIFO: insertion is always onto the end of the queue, removal is from the front Computing Systems http://www.cs.caltech.edu/cs134/cs134a August 23, 2014

More Related