Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Structuring of Systems Using Upcalls Paper by David D. Clark Presentation by Emerson Murphy-Hill.

Similar presentations


Presentation on theme: "The Structuring of Systems Using Upcalls Paper by David D. Clark Presentation by Emerson Murphy-Hill."— Presentation transcript:

1 The Structuring of Systems Using Upcalls Paper by David D. Clark Presentation by Emerson Murphy-Hill

2 Objectives Build Swift operating system Develop and describe layered OS methodology that is: –Supportive of highly interactive, parallel execution –Based on layered network protocols –Coherent and easily readable –Simple, short, and efficient

3 General Architecture Tasks Multitask modules (layers) Processes Subroutine Calls Synchronized process calls (IPC) Interprocess (intermodule?) Communication Interprocess Communication Swift Standard Layers (Dijkstra)

4 Layers / Multitask Modules Each layer is an encapsulated module: –Private state –Accessible only through subroutine calls A layer “depends on” the layer below A layer is a coherent piece of functionality Layer “instance of” multitask module (analogously – object instance of class)

5 Call Direction Typically down through layers (example: send data) Can be upcall (example: more data?), but: –Do nice testing properties remain? –What are the semantics of the relationship of a lower to an upper layer? –What about recursion?

6 display-start(): local-port = transport-open(display-receive) end display-receive(char) : //write char to display end transport-open(receive-handler): local-port = net-open (transport-receive) transport-handler-array (local-port)=receive-handler return(localport) end transport-get-port(packet): //upcalled by interruptlayer extract port from packet return(port) end transport-receive(packet,port): //upcalled by net-layer handler=transport-handler-array(port) validate packet header for,each char in packet do handler(char) end net-open(receive-handler): port=generate-uid() task-id = create-task( net-receive( port, receive-handler)) net-task-array(port)=task-ld return(port) end net-receive(port,handler): handler=net-handler-array(port) do forever remove packet from port queue handler(packet,port) block() end net-dispatch(): //upcalled by interrupt handler read packet from device restart device port = transport-get-port(packet) put packet on per port queue task-id = net-task-array(port) wakeup-task(task-ld) end Display Layer Transport Layer Net Layer transport_handler_array[p] = {display-receive} net_task_array[p] = {net-receive(p,transport_receive)}

7 display-start(): local-port = transport-open(display-receive) end display-receive(char) : //write char to display end transport-open(receive-handler): local-port = net-open (transport-receive) transport-handler-array (local-port)=receive-handler return(localport) end transport-get-port(packet): //upcalled by interruptlayer extract port from packet return(port) end transport-receive(packet,port): //upcalled by net-layer handler=transport-handler-array(port) validate packet header for,each char in packet do handler(char) end net-open(receive-handler): port=generate-uid() task-id = create-task( net-receive( port, receive-handler)) net-task-array(port)=task-ld return(port) end net-receive(port,handler): handler=net-handler-array(port)? do forever remove packet from port queue handler(packet,port) block() end net-dispatch(): //upcalled by interrupt handler read packet from device restart device port = transport-get-port(packet) put packet on per port queue task-id = net-task-array(port) wakeup-task(task-ld) end transport_handler_array[p] = {display-receive} net_task_array[p] = {net-receive(p,transport_receive)}

8 Advantages of Methodology Generally, layers have low-coupling Uses subroutine calls: –Substantially cheaper than IPC / RPC (no context switching or message queue management) –Preserves traditional programming semantics –Fast! –No need to implement communication protocol Best suited towards interactive and network-based systems

9 Encountered Problems Local upcall failure. Control propagation through: –Partitioning/recover data –Destroy task stripe Indirect recursive calls corrupt state. Solutions: –Completely reevaluate state on return (expensive/clumsy) –Prohibit recursive downcall while doing upcall (runtime only) Locking problems –Solution: queue work on recursive lock conflict (not implemented) –Not easy to impose locking discipline

10 Other Features Task Scheduling –Dynamic priority based on deadline –Deadline promotion Address Space Management –Compile/runtime checking for pointers, etc –Garbage collection

11 Conclusion Layers with upcalls are suitable for “a large class of programming problems” – if you have good programmers! Layers implemented as: –processes are bad –multitask modules are good (fast and simple)


Download ppt "The Structuring of Systems Using Upcalls Paper by David D. Clark Presentation by Emerson Murphy-Hill."

Similar presentations


Ads by Google