On the Duality of Operating System Structures - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

On the Duality of Operating System Structures

Description:

{ int widget; message m; for(0 to N) sendMsg(producer, &m); // send bufferSz empty msgs ... put_item(widget); // put item in buffer. count = count 1; ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 14
Provided by: pli4
Learn more at: http://www.cs.ucf.edu
Category:

less

Transcript and Presenter's Notes

Title: On the Duality of Operating System Structures


1
On the Duality of Operating System Structures
  • Hugh C. Lauer, Xerox Corporation, Palo Alto, CA
  • Roger M. Needham, Cambridge University,
    Cambridge, England

Tracy Wagner COP 6614 September 13, 2005
2
Introduction
  • Focus on OS Properties of
  • Process
  • Synchronization
  • Interprocess Communication
  • Two System Categories
  • Message-oriented
  • Procedure-oriented

3
Message-oriented Systems
  • Pass messages (events) easily and efficiently
    among processes
  • Peripheral devices treated as processes
  • Messages and message identifiers
  • Queue messages at destination processes until
    action can be taken
  • Synchronization and queuing implemented in
    message queues
  • Processes operate on one message at a time

4
Message-oriented Systems
  • Specific communication paths
  • Message Channels and Message Ports
  • SendMessage, WaitForMessage, AwaitReply,
    SendReply operations
  • Static number of processes and connections
  • Process declarations
  • CreateProcess operation
  • Processes operate in a static context
  • Priorities statically assigned
  • Data structures passed by reference

5
Producer/Consumer (Message-oriented)
  • Consumer()
  • int widget message m
  • for(0 to N)
  • sendMsg(producer, m) // send bufferSz
    empty msgs
  • while (TRUE)
  • awaitReply(producer, m) // get msg with new
    item
  • extract_item(m, widget)
  • sendMsg(producer, m) // reply with
    empty msg
  • consume_item(widget) // consume the item
  • Producer()
  • int widget message m // message buffer
  • while (TRUE)
  • make_item(widget) // create
    a new item

6
Procedure-oriented Systems
  • Simple process creation/deletion
  • Processes inherit priorities dynamically
    priorities associated with locks
  • Global naming schemes important
  • Procedure protection mechanisms
  • Synchronization and queuing implemented by
    processes waiting for locks
  • Control of and interrupts from peripheral devices
    by manipulation of locks and/or shared data

7
Procedure-oriented Systems
  • Efficient procedure calls
  • Synchronous
  • Asynchronous
  • FORK and JOIN operations
  • Synchronizing data structures
  • Data shared directly among processes
  • Condition variables
  • WAIT, SIGNAL operations
  • Processes typically have only one task

8
Producer/Consumer (Procedure-oriented)
  • monitor ProducerConsumer
  • condition full, empty int count
  • procedure enter()
  • if (count N) wait(full) // if buffer is
    full, block
  • put_item(widget) // put item in
    buffer
  • count count 1
  • if (count 1) signal(empty)// wake
    consumer
  • procedure remove()
  • if (count 0) wait(empty) // if buffer
    empty, block
  • remove_item(widget) // remove
    from buffer
  • count count - 1
  • if (count N-1) signal(full)// wake
    producer

9
Producer/Consumer (Procedure-oriented)
  • Producer()
  • while (TRUE)
  • make_item(widget) // make a new item
  • ProducerConsumer.enter // call enter in
    monitor
  • Consumer()
  • while (TRUE)
  • ProducerConsumer.remove // call remove in
    monitor
  • consume_item // consume an
    item

10
System Comparison
  • Message-oriented systems
  • Passing messages only interaction
  • Own address space
  • Requests handled serially
  • Procedure-oriented systems
  • Procedural interaction
  • Movement from context to context across module
    boundaries
  • Depend on monitor locks and condition variables

11
Mapping
Message-oriented
Procedure-oriented
Processes, CreateProcess
Monitors, NEW/START
Procedure identifiers, ENTRY procedure identifiers
Message Channels, Message Ports
SendMessage AwaitReply (immediate)
Simple procedure call
  • SendMessage AwaitReply (delayed)
  • FORKJOIN

12
Mapping
Message-oriented
Procedure-oriented
SendReply
RETURN from procedure
Lock, ENTRY attribute
Main loop, WaitForMessage statement, case
statement
ENTRY procedure declarations
Arms of case statement selective
  • Condition variables, WAIT, SIGNAL
  • Waiting for messages

13
Conclusions
  • Models are Duals
  • Similarity of Programs
  • Identical Performance
Write a Comment
User Comments (0)
About PowerShow.com