Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Structuring of Systems Using Upcalls David D. Clark 4/26/20111Frank Sliz, CS533, Upcalls.

Similar presentations


Presentation on theme: "The Structuring of Systems Using Upcalls David D. Clark 4/26/20111Frank Sliz, CS533, Upcalls."— Presentation transcript:

1 The Structuring of Systems Using Upcalls David D. Clark 4/26/20111Frank Sliz, CS533, Upcalls

2 Overview A method for implementing layers with synchronous procedure calls between layers Upcalls – flow of control by a lower layer calling an upper layer via procedure call Multi-task module – subroutines in different tasks that make up the layer 4/26/2011Frank Sliz, CS533, Upcalls2

3 Outline Background Upcalls and Multi-task Modules Example Advantages Swift Operating System Problems Conclusions 4/26/2011Frank Sliz, CS533, Upcalls3

4 Background 1968 – THE operating system Great interest in using layers to structure OS 1982 – ISO model for network communication 1985 – Swift operating system 4/26/2011Frank Sliz, CS533, Upcalls4

5 Monolithic Operating System 4/26/2011Frank Sliz, CS533, Upcalls5

6 Layered Operating System 4/26/2011Frank Sliz, CS533, Upcalls6

7 Advantages of Layered OS Modularity Easier to test and debug Easier to modify Acyclic dependency Verification Trustworthiness 4/26/2011Frank Sliz, CS533, Upcalls7

8 7-Layer OSI Model 4/26/2011Frank Sliz, CS533, Upcalls8 application presentation session transport network data link physical 5 6161 7 4 6 2 3 1

9 Disadvantages of Layered OS Performance – Asynchronous communication between layers – Buffering of data between layers – Copying of data for crossing protection boundary – Programming complexity Inefficient support for upward flow of control 4/26/2011Frank Sliz, CS533, Upcalls9

10 Upcalls and Multi-Task Modules Upcalls – Flow of control by a lower layer calling an upper layer via procedure call Multi-Task Modules – Subroutines in different tasks that make up the layer – Subroutines are callable from above or below via procedure calls – State variables in shared memory 4/26/2011Frank Sliz, CS533, Upcalls10

11 System Organization 4/26/2011Frank Sliz, CS533, Upcalls11

12 Example - Network Protocol 3 Layers and 3 Tasks 4/26/2011Frank Sliz, CS533, Upcalls12 Display Transport Network CreateReceiveSend

13 Control Flow in Network Protocol 4/26/2011Frank Sliz, CS533, Upcalls13 Transport Layer Display Layer Network Layer

14 Example - Display Layer Network Protocol 4/26/2011Frank Sliz, CS533, Upcalls14

15 Example - Transport Layer Network Protocol 4/26/2011Frank Sliz, CS533, Upcalls15

16 Example Network Layer Network Protocol 4/26/2011Frank Sliz, CS533, Upcalls16

17 Example – Create Task 4/26/2011Frank Sliz, CS533, Upcalls17

18 Example – Receive Task 4/26/2011Frank Sliz, CS533, Upcalls18

19 Example – Send Task 4/26/2011Frank Sliz, CS533, Upcalls19

20 Advantages of Upcalls Upward, synchronous flow via procedure call is more efficient than IPC No need for data buffering between layers Simplicity of implementation Lower layer can ask advice from upper layer resulting in simplification of algorithm 4/26/2011Frank Sliz, CS533, Upcalls20

21 Advantages of Multi-Task Modules Subroutine interfaces are easier to deal with than IPC interfaces No system wide IPC message format needed Decisions about task usage can be made later, the tasks are not hard coded into the layers Acknowledgements can be sent with new data packet - Piggybacking 4/26/2011Frank Sliz, CS533, Upcalls21

22 Swift Operating System Explore upcall and multi-module usage Single address space with a typesafe language Monitor locks for access to shared state Initially used for network protocols Test to determine if useful in other contexts Develop solutions for upcall problems 4/26/2011Frank Sliz, CS533, Upcalls22

23 Problems with Upcall Violates basic principle of layering – upcall failure could leave lower layer left in unstable condition Recovery of resources when an upcall fails Upcall gets into an infinite loop 4/26/2011Frank Sliz, CS533, Upcalls23

24 Mitigating Upcall Failures 2 classes of data – Client or private data which is expendable – Data shared between tasks must be unlocked and consistent before upcall Expendable tasks Layer-specific cleanup via system procedures Timer or User to detect infinite loop 4/26/2011Frank Sliz, CS533, Upcalls24

25 Solutions to Indirect Recursive Call Put state variables in consistent state before upcall and then reevaluate them upon return Prohibit recursive downcall – variables can be left locked and inconsistent when upcalling Downcall queues the work for later execution Downcall is restricted in its actions Downcall is replaced by extra arguments or it is replaced by a second upcall to query 4/26/2011Frank Sliz, CS533, Upcalls25

26 Problems with Multi-Task Modules Failure to use monitor locks properly which can cause incorrect results With single shared memory address space program bugs can corrupt memory Need queues for suspended tasks waiting to obtain monitor locks 4/26/2011Frank Sliz, CS533, Upcalls26

27 Conclusions Methodology is useful for operating systems – upcalls and multi-task modules are efficient – Strongly checked typesafe language should be used in a single shared address space – useful for network protocols, text editors, and I/O Bad idea to implement a layer as a process Parallel systems need shared memory for efficient communication between processes 4/26/2011Frank Sliz, CS533, Upcalls27


Download ppt "The Structuring of Systems Using Upcalls David D. Clark 4/26/20111Frank Sliz, CS533, Upcalls."

Similar presentations


Ads by Google