Presentation is loading. Please wait.

Presentation is loading. Please wait.

TAME – Event Style Programming with Threads

Similar presentations


Presentation on theme: "TAME – Event Style Programming with Threads"— Presentation transcript:

1 TAME – Event Style Programming with Threads
Threads vs. Events TAME – Event Style Programming with Threads 5204 – Operating Systems

2 implemented via source-source translation avoids stack ripping
TAME expressive abstractions for event-based programming implemented via source-source translation avoids stack ripping type safety and composability via templates M. Krohn, E. Kohler, M.F. Kaashoek, “Events Can Make Sense,” USENIX Annual Technical Conference, 2007, pp CS 5204 – Operating Systems

3 A typical thread programming problem
f (blocking, synchronous operation, e.g., I/O) c Problem: the thread becomes blocked in the called routine (f) and the caller (c) is unable to continue even if it logically is able to do so. CS 5204 – Operating Systems

4 A partial solution c f Issues
(non-blocking, asynchronous operation, e.g., I/O) register handler (signal + data) Issues Synchronization: how does the caller know when the signal has occurred without busy-waiting? Data: how does the caller know what data resulted from the operation? CS 5204 – Operating Systems

5 A “Tame” solution c f <I> <T> <I> <T> e r:
(1) (2) (4) (3) (5) (non-blocking, asynchronous operation, e.g., I/O) (10) (11) <I> r: slot <T> a; (9) e(a): <T> handler (7) e.trigger(data) a <- data (8) (signal + data) (6) <I> rendezvous<I> <T> event<T> wait point CS 5204 – Operating Systems

6 Tame Primitives CS 5204 – Operating Systems

7 An example tamed gethost_ev(dsname name, event<ipaddr> e);
CS 5204 – Operating Systems

8 Variations on control flow
parallel control flow window/pipeline control flow CS 5204 – Operating Systems

9 Event IDs & Composability
CS 5204 – Operating Systems

10 Closures f( …params…) { rendezvous<> r; tvars { …locals…}; twait(r); continue_here: } copy copy closure r: Smart pointers and reference counting insure correct deallocation of events, redezvous, and closures. CS 5204 – Operating Systems

11 Performance (relative to Capriccio)
CS 5204 – Operating Systems


Download ppt "TAME – Event Style Programming with Threads"

Similar presentations


Ads by Google