1 / 22

On the Duality of Operating System Structures

On the Duality of Operating System Structures. - Lauer, Needham. Presented by Myoungkyu Song. Contents. Key Point Message-Oriented System Structure Procedure-Oriented System Structure Duality Mapping Similarity of Programs Preservation of Performance Conclusion Evaluation. Key Point.

lolajohnson
Download Presentation

On the Duality of Operating System Structures

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. On the Duality of Operating System Structures - Lauer, Needham Presented by Myoungkyu Song

  2. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  3. Key Point • 1970's - in those days of this paper Message-oriented Structure / Procedure-oriented Structure • Modern Event-based Model / Thread-based Model • Thread-based System Structure need Data Protection Mechanism. • But, Event-based System Structure do not have it so, any process do MUST NOT WAIT.

  4. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  5. Message-Oriented System Structure • Relatively small, static number of processes • With an explicit message system for communicating among them

  6. Message-Oriented System Structure begin m : messageBody i: messageId; p:portId; s: set of portId; initialize; do forever; [m,i,p] <- WaitForMessage[s]; case p of port1 => ...; --algorithm for port1 port2 => ... if resourceExhausted then s <- s - port2; SendReply [i, reply]; ...; --algorithm for port2 ... portk => ... s <- s + port2 ...; --algorithm for portk endcase endloop end. { ResourceManager(int n) { // initialize } run() { while (true) { msg = WaitForMessage (s); p = msg.getPort (); if ( p == acquire ) { r = resourceAvailable.pop (); if (resourceAvailable.empty() ) s.remove (acquire); msg.sendReply( r ); } else if (p == release) { resourceAvailable.push( (Resource) msg.getBody()); s.add (acquire); } } // endloop [ Example Code in Java style ] class ResourceManager extends Thread (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

  7. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  8. Procedure-Oriented System Structure • Large, rapidly changing number of small Processes • Cooperation among process is achieved by locks, semaphore, monitor, or other synchronizing data structure

  9. Procedure-Oriented System Structure ResourceManager:MONITOR = c: CONDITION; resourceExhausted:BOOLEAN; proc1:ENTRY PROCEDURE[...] = ...;--algorithm for proc1 proc2:ENTRY PROCEDURE[...] RETURN[...] = BEGIN IF resourceExhausted THEN WAIT c; ... RETURN[results]; END; ... procL:ENTRY PROCEDURE[...] = BEGIN ...; resourceExhausted <- FALSE; SIGNAL c; ...; END; endloop initialize; END. synchronized Resource acquire() { while (resourcesAvailable.isEmpty()) try { wait(); } catch (InterruptedException ie) { } return resourcesAvailable.pop(); } synchronized void release(Resource r) { resourcesAvailable.push(r); notify(); } [ Example Code in Java style ] ResourceManager (int n) { resourcesAvailable = new Stack<Resource>(); for (int i = 1; i <= n; i++) { resourcesAvailable.push( Rsc Obj ); } }

  10. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  11. The duality Mapping & Similarity

  12. The duality Mapping & Similarity (contd.)

  13. The duality Mapping & Similarity (contd.)

  14. The duality Mapping & Similarity (contd.)

  15. The duality Mapping & Similarity (contd.) • The wait statement in the procedure-oriented model provides a considerably richer synchronization facility than does selective waiting for messages in the message-oriented model. • However, this is NOT without its disadvantage.

  16. The duality Mapping & Similarity (contd.) • 'Selective Waiting' allows Message-oriented System to • wait for more than a single rendezvous at any time. • time-out if no rendezvous is forthcoming within a specified time. • withdraw its offer to communicate if no rendezvous is available immediately • terminate if no clients can possibly call its entries

  17. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  18. Preservation of Performance • Process switching can be made equally fast in either system • Virtual memory and paging or swapping can even be used with • equal effectiveness in either model

  19. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  20. Conclusion • Which Kinds of systems are "better" to build • Designer needs to perceive until too late after the system starts to operate

  21. Contents • Key Point • Message-Oriented System Structure • Procedure-Oriented System Structure • Duality Mapping • Similarity of Programs • Preservation of Performance • Conclusion • Evaluation

  22. Evaluation Example: To manage to control when Slide Up and Down fast repeatedly. In this case Message-Queue is needed. So, Message-oriented is Better. UI PROCESS :EVENT RECEIVER KEY PROCESS :EVENT SENDER Slide Up Slide Down SLIDE_UP_EVENT SLIDE_DOWN_EVENT SLIDE_UP_EVENT MESSSAGE QUEUE SLIDE_DOWN_EVENT SLIDE_UP_EVENT SLIDE_DOWN_EVENT SLIDE_UP_EVENT SLIDE_DOWN_EVENT

More Related