Operating Systems: Process Management and Interprocess Communication, Study notes of Computer Science

An overview of process management and interprocess communication in operating systems. Topics include process description, process states, context switching, process scheduling, and various interprocess communication mechanisms such as shared memory and message passing. The document also discusses the advantages and disadvantages of each mechanism.

Typology: Study notes

Pre 2010

Uploaded on 09/24/2009

koofers-user-uks
koofers-user-uks 🇺🇸

10 documents

1 / 40

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems
Operating Systems
CMPSC 473
CMPSC 473
Process Management
Process Management
January 31, 2008 - Lecture
January 31, 2008 - Lecture
5
5
Instructor: Trent Jaeger
Instructor: Trent Jaeger
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download Operating Systems: Process Management and Interprocess Communication and more Study notes Computer Science in PDF only on Docsity!

Operating SystemsOperating Systems

CMPSC 473 CMPSC 473

Process Management Process Management

January 31, 2008 - Lecture January 31, 2008 - Lecture 55

Instructor: Trent Jaeger Instructor: Trent Jaeger

  • Last class:
    • Process Creation
  • Today:
    • Process Management

Process State

  • What do we need to track about a process?

Process Control Block

  • State of running process
  • Linked list of process control information Process id Program Counter … Other registers Process state Ptr to linked list Main Memory (RAM) OS Processes

/proc File System

  • Linux and Solaris
    • ls /proc
    • A directory for each process
  • Various process information or ways to write to the

process

  • /proc//io -- I/O statistics
  • /proc//environ -- Environment variables (in binary)
  • /proc//stat -- process status and info

Context Switch

  • OS switches from one execution context to another
    • One process to another process
    • Interrupt handling
    • Process to kernel ( mode transition , not context switch)
  • Current Process to New Process
    • Save the state of the current process
      • Process control block which describes the state of the process in the CPU
    • Load the saved context for the new process
      • Load the new process’s process control block into OS and registers
    • Start the new process
  • Does this differ if we are running an interrupt handler?

Context Switch

  • No useful work is being done during a context

switch

  • Speed it up
  • Hardware support
  • Multiple register sets (Sun UltraSPARC)
  • However, hardware optimization may conflict
  • TLB flush is necessary
  • Different virtual to physical mappings on different processes

Process Description Summary

  • Serves two purposes
    • Track per process resources
    • Save process state on context switch
  • Process control block
    • Represents both aspects
    • CPU state
      • Progam counter, registers
    • Resources
      • Linked lists of pages, child processes, files, etc.

Process Scheduling

  • What do we need to know about processes to

choose the next one to run?

  • Actual scheduling details/algorithms will be discussed later

Scheduling Processes

• Processes transition among execution states

State Transitions

  • New Process ==> Ready
    • Allocate resources
    • End of process queue
  • Ready ==> Running
    • Head of process queue
    • Scheduled
  • Running ==> Ready
    • Interrupt (Timer)
    • Back to end of process queue

State Transitions:

Page Fault Handling

  • Running ==> Waiting
    • Page fault exception (similar for syscall or I/O interrupt)
    • Wait for event
  • Waiting ==> Ready
    • Event has occurred (page fault serviced)
    • End of process queue (or head?)
  • Ready ==> Running
    • As before…

Interprocess Communication

Process Communication

  • Processes need to share information
    • Don’t work in isolation
  • Discuss a variety of ways
    • Doesn’t include normal files and signals