Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presented by: JungChun Lu. Goal Propose a design methodology suitable for operating system programs which: Permits synchronous procedure call between.

Similar presentations


Presentation on theme: "Presented by: JungChun Lu. Goal Propose a design methodology suitable for operating system programs which: Permits synchronous procedure call between."— Presentation transcript:

1 Presented by: JungChun Lu

2 Goal Propose a design methodology suitable for operating system programs which: Permits synchronous procedure call between layers in both upward and downward direction. Provides runtime support for highly interactive parallel software packages.

3 Layered Architecture Layered architectures have inherent advantages: Helps system organization. Acyclic dependency graph, better for verification. Stand alone testing at any layer. Modularity and portability. Layered architectures typically have an implicit hierarchy of trust and reliability: As we move down the layers, the trustworthiness of the system increases. If a higher layer fails, the lower levels are still uncorrupted.

4 Limitation of Layered Architecture Data flow of Layered Architecture: Each layer is implemented as a process. Data flows are using asynchronous Inter-process communication between layers. Data flow upwards is typically inefficient Either inter-process signaling or polling to indicate data availability. Some cases require data buffering and/or copying of data from lower layer to a higher layer. Proposal to Overcome the Inefficiencies: Add support for Upcalls. Allow procedure calls from lower layers to higher layers. Intended to address the imbalance of the system. Enable “true” subroutine calls for both upwards and downwards. Intended to modulate and balance data flow.

5 Swift Layered Architecture Each layer is composed of a set of sub- routines which can be invoked both upwards and downwards and is an encapsulated multitask module. Implemented using a single address space. For storing variables. For efficient passing of data between layers. Coordination across subroutines within the same layer using shared memory. Multitask Modules. Easy access to relevant state information for all tasks. User tasks span vertically all the way from the top layers to the bottom layers. Upper layer is always “available” to the lower layer and vice versa.

6 Multi-task Modules Each layer defined as a collection of subroutines: called multi-task modules. Subroutines live in number of tasks in a layer. Layers communicate through subroutine calls. Each layer contains private state which are accessible through shared memory. Various tasks in a layer communicate using state variables.

7 Structure Comparison TCP IP Ethernet Driver FTP Client Ethernet Inter-process Communication Process Multitask Modules Thread / task Subroutine Calls Tasks Inter-process Communication Swift Layer StructureTCP/IP Layer Structure

8 Layered Protocol Example Client has some data to send and initiate a connection with downcall arming. Behavior when data is received. Transport-open downcalled by display-start, and it determines how the data should be formatted. Transport layer receive function that reformats the input and upcalls to the application layer receive function. Upcalled by net-dispatch to determine which transport level entity should receive the packet. Net-open is downcalled by transport-open, and it determines where and when to send the data. The signaled task starts running by executing the program net-receive and then upcalls the subroutine transport-receive. 1.The subroutine net-dispatch is upcalled by interrupt handler. 2.Using information from transport-get-port, it selects the correct task from a table and then signals that task.

9 Advantages of Methodology All communication between layers is through subroutine calls, which makes it efficient. Inter-Process Communication is limited, only within a layer through private interface of that layer. Transport layer can indicate availability of another packet to send and enable piggy-back of Ack with new data to send.

10 Advantages of Methodology With Multitask Modules: It is easier to understand and less threading. Decisions about how tasks are used need not be defined until late in design time. Data flow control simplicity: Data is never duplicated in the transaction layer. Do not need to enable data buffering and back-pressuring between layers.

11 Disadvantages of Methodology Reliability Problem: If an upper layer fails during upcall, data and states in lower layers may be corrupted. Potential Solutions: Recover shared variable in lower layers: Organize the data into two categories – The data associated with each client. The data describes the way various clients interact and share the resources. Recover or determine task executing code: Tasks should be expendable - If a client fails to return, the task can be thrown away as long as no locks for shared resources are held with that task. Implement layer specific cleanup mechanisms to reclaim lost resources due to invalid tasks.

12 Disadvantages of Methodology Loop Problem: How to distinguish between a task in a loop and the one running for a long time? Potential Solution: Use timers. Make a human oversee it.

13 Disadvantages of Methodology Trustworthy Problem: Violation of trust between layers. Potential Solution: Programmers need to be skilled enough to organize the resources properly.

14 Disadvantages of Methodology Recursive Call Problem: Indirect recursive calls can lead data corruption. Potential Solution: Put variables on consistent state and reevaluate on call return. Prohibit an upcall from making any recursive downcall. Queue the work request for later execution. Make the recursive call set flags for later examination. Replace the downcall by extra return arguments to upcall to query the client.

15 Disadvantages of Methodology Multitask module requires parallel programming with shared memory can lead to problems: Inappropriate usage of locks can cause deadlock while doing downcall and upcall. Potential Solutions: Rely on Competent programmers. Use other inter-process communication techniques for synchronization. Possibly have a main task that performs the actual actions. Starts resembling traditional layered architecture with the primary task being a layer in itself.

16 Conclusion Layers implemented as processes is a bad idea. Upcalls are simple and efficient. Swift OS is portable. The methodology is Suitable for Network protocols and text editors. Efficiency of the system depends on the skill level of the programmer.

17 Reference David D. Clark, “The Structuring of Systems Using Upcalls.” 1985. Slides from Madhura Rama, Winter 2006. Slides from Prassnitha Sampath, Winter 2009.


Download ppt "Presented by: JungChun Lu. Goal Propose a design methodology suitable for operating system programs which: Permits synchronous procedure call between."

Similar presentations


Ads by Google