Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the.

Similar presentations


Presentation on theme: "Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the."— Presentation transcript:

1 Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the Opposite of Threaded Programming Published by USENIX 2002 Annual Technical Conference

2 Cooperative Task Management without Manual Stack Management The Authors  Atul Adya  PhD MIT. Boston, MA  Thor – distributed, object-oriented database  Microsoft Research. Redmond, WA  Farsite – serverless, distributed file system  http://research.microsoft.com/Farsite/ http://research.microsoft.com/Farsite/  et al. (Howell, Theimer, Bolosky, Douceur)

3 Cooperative Task Management without Manual Stack Management Paper’s Goal  Clarify concepts associated with the event- driven and multi-threaded programming models.  The models’ names tend to merge several concepts and this causes confusion.  Present a hybrid approach to allow the two types of stack management to co-exist in the same software.

4 Cooperative Task Management without Manual Stack Management Events vs. Threads The Source of Confusion  Task Management  Serial  Preemptive  Stack Management  Manual  Automatic

5 Cooperative Task Management without Manual Stack Management Events vs. Threads The Source of Confusion  Task Management  Serial  Preemptive  Cooperative  Stack Management  Manual  Automatic  Hybrid One can choose cooperative task management while preserving the automatic stack management.

6 Cooperative Task Management without Manual Stack Management Stack Management  Manual (big pain)  Event handler registers continuation with EH scheduler. The continuation creates another EH that knows what to do with original’s info.  Programmer must figure this all out.  Better not have bugs.  As the code evolves, managing the stack becomes more unwieldy.  Benefit: Yields are visible in the code.

7 Cooperative Task Management without Manual Stack Management Stack Management  Automatic (less pain)  Compiler manages stack.  Danger: Hidden concurrency.  Solution = Check for declared assumptions.

8 Cooperative Task Management without Manual Stack Management Stack Management - Hybrid  The two flavors of stack management both have passionate advocates.  Both flavors can work together via a Hybrid approach.  Adapters are used to bridge the two styles.

9 Cooperative Task Management without Manual Stack Management Adapter Functions Main Thread: VerifyCertCFA

10 Cooperative Task Management without Manual Stack Management Adapter Functions VerifyFiber was created by VerifyCertCFA in the MainFiber

11 Cooperative Task Management without Manual Stack Management Adapter Functions

12 Cooperative Task Management without Manual Stack Management Adapter Functions Verify Thread: FiberStart Main Thread: VerifyCertCFA VerifyCertCFA2

13 Cooperative Task Management without Manual Stack Management In Practice  Farsite  Started out as traditional event-driven.  Code grew, manual-stack-management became costly.  Mechanized the wrapping IO functions.

14 Cooperative Task Management without Manual Stack Management What the Authors Think  Task management and stack management are orthogonal concepts.  As code evolves:  Event-based programs have the code restructuring burdon of stack ripping.  Both styles must reconfirm invariant logic because assumptions change, etc.  Hybrid-stack-management allows use of both styles of stack management.

15 Cooperative Task Management without Manual Stack Management What I Think


Download ppt "Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the."

Similar presentations


Ads by Google