outline n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Outline PowerPoint Presentation
Download Presentation
Outline

Loading in 2 Seconds...

play fullscreen
1 / 28

Outline - PowerPoint PPT Presentation


  • 160 Views
  • Uploaded on

Outline. Process Management. Process Manager. Process manager creates the process abstraction It implements a software environment for processes to run Process manager consists of Basic algorithms and data structures to implement the process and resource abstractions Scheduling

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Outline' - emery-burt


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
outline
Outline
  • Process Management
process manager
Process Manager
  • Process manager creates the process abstraction
    • It implements a software environment for processes to run
  • Process manager consists of
    • Basic algorithms and data structures to implement the process and resource abstractions
    • Scheduling
    • Process synchronization
    • A deadlock strategy
    • Protection strategy

COP4610

process model
Process Model
  • A process consists of the following tangible elements
    • A program to define the behavior of the process
    • The data operated on by the process and the results it produces
    • A set of resources
    • The process descriptor for the OS to keep track of the process

COP4610

process descriptor
Process Descriptor
  • Process descriptor (also called process control block)
    • Is the data structure used by the process manager to record the status of a process while the process manager algorithms monitor and control the process

COP4610

process descriptor cont
Process Descriptor – cont.
  • Process descriptor includes the following
    • Its processor registers contents at the time it was last suspended
    • Its processor state
    • The address space mapping details
    • Its memory state
    • A pointer to its stack
    • The resources that have been allocated to it
    • The resources that it needs

COP4610

process state diagram cont
Process State Diagram – cont.
  • Process creation (new  ready)
    • Create/find an available process descriptor entry
    • Assign a unique process ID
    • Define the address space that the process needs
    • Load the desired program into the address space
    • Initialize the data, stack, and resources available to the process
    • Set the process’s state to ready and add to the ready queue

COP4610

process state diagram cont1
Process State Diagram – cont.
  • Ready list – set of all processes residing in main memory, ready and waiting to execute
  • Ready  Running
    • By the CPU scheduler
    • When the process is chosen to run next, the OS restores the register values from the process descriptor, including PC and the process starts running again

COP4610

process state diagram cont2
Process State Diagram – cont.
  • Context switch
    • When CPU is switched to another process, the system must save the status of the old process and load the saved status for the new process
    • Context switch time is overhead; the system does not do useful work while switching from application’s point of view
    • Context switch time is hardware dependent; it can be a significant factor in CPU scheduling algorithm design

COP4610

process state diagram cont3
Process State Diagram – cont.
  • How many context switches does it take for the
  • OS to switch from one user process to another?

COP4610

process state diagram cont4
Process State Diagram – cont.
  • Running  Blocked
    • When the resources requested by the process are not available immediately, the process will be blocked, and its state will be changed from running to blocked and be removed from the ready list

COP4610

process state diagram cont5
Process State Diagram – cont.
  • Running  Ready
    • In a time-sharing system, when a process uses its allowed time slice, it will be suspended by OS through a timer interrupt
    • The process will be put back to the ready list and the scheduler will choose one among the ready processes

COP4610

process state diagram cont6
Process State Diagram – cont.
  • Running  Running
    • When the resources requested are available immediately, the process allows to continue to run.
    • This, however, depends on the scheduling algorithm implementation

COP4610

process state diagram cont7
Process State Diagram – cont.
  • Running  Terminated
    • When a process finishes, the OS will release the resources allocated to the process
    • The process descriptor data structure will also be released
      • However, it may not be done immediately
      • In UNIX, the process descriptor is released after the parent has called “wait” system call to collect its status information
      • If the process’s parent exits before it does, the process becomes a zombie

COP4610

process state diagram cont8
Process State Diagram – cont.
  • Blocked  Ready
    • When the resources requested by the process become available, the process will be marked as ready and be put back into the ready list

COP4610

process address space
Process Address Space
  • Process address space
    • A set of locations used by a process to reference primary memory locations, OS services, and resources

COP4610

resource manager
Resource Manager
  • Each resource type is associated with a resource manager
    • The resource manager is responsible for allocating resources to processes and returning released resources

COP4610

resource manager cont1
Resource Manager – cont.
  • Resource descriptor is to save the state of the resource type

COP4610

resource manager cont3
Resource Manager – cont.
  • Reusable resources
    • Resources that can be allocated and must be returned to the system after the process has finished using them
    • Such as memory
  • Consumable resources
    • Resources that can cause a process to be blocked on request but are never released by that process
    • Such as input data

COP4610