1 / 17

Event-Driven Programming

maxine
Download Presentation

Event-Driven Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Cooperative Task Management without Manual Stack Managementor, Event-driven programming is Not the Opposite of Threaded ProgrammingAtul Adya, Jon Howell, Marvin Theimer, William J. Bolosky, John R. DouceurMicrosoft ResearchPresented by: Yujing He ( hey@cecs.pdx.edu )CS 533-April 24th, 2006

  2. Event-Driven Programming

  3. Threads & Fibers ☆ Threads ♦ lightest unit of kernel scheduling; ♦ preemptively scheduled; ♦ a stack and a copy of the registers; ☆ Fibers ♦implemented in user space; ♦ cooperatively scheduled; ♦ efficient context switching;

  4. Definitions ☆ Task Management preemptive, serial, cooperative ☆ Stack Management manual (event-driven), automatic (procedure-oriented) ☆ I/O Management synchronous, asynchronous ☆ Conflict Management pessimistic, optimistic ☆ Data Partitioning might reduce resource conflict

  5. Concepts Relations

  6. Other Concepts ☆ Continuation ♦ bundles state indicating where the event left off working on the task; ♦ plus a reference to an event-handler that encodes what should be done when the requested I/O has completed. ☆ Stack Ripping ♦ functions along the path ripped into more parts because of I/O calls; ♦ primary drawback to manual stack management in event-driven programming

  7. Hybrid Approach ☆ Based on Windows Operating System ♦ Threads are scheduled preemptively; Fibers are scheduled cooperatively; ♦ Scheduling multiple fibers on a thread; Only one fiber is active at any time. ♦ Using adapter to connect between threaded programming and event programming; ☆ Examples ♦ Manual calling Automatic—Event calling Thread; ♦ Automatic calling Manual—Thread calling Event;

  8. Hybrid Approach (Continued) ☆ Function Names GetCertData—Looks up certificate in the memory catch or disk/network and returns the answer; (manual) GetCAInfo—looks in a hash-table for a specified certificate authority (CA) id and returns a pointer to the corresponding object; (manual) VerifyCert—calls “GetCAInfo” to obtain a CA with which to verify a certificate; (automatic) FetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity; (manual) FiberContinue—a continuation for event handlers; (manual) CFA—Continuation-to-Fiber Adapter (in Manual calling Automatic) FCA—Fiber-to-Continuation Adapter(in Automatic calling Manual)

  9. ManualCallingAutomaticFetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

  10. ManualCallingAutomaticFetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

  11. AutomaticCallingManualFetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

  12. AutomaticCallingManualFetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

  13. AutomaticCallingManualShort Circuit Branch No I/O Block

  14. Implementation ☆Farsite: a distributed, secure, serverless file system running over desktops; (Windows NT) ☆ UCoM: a wireless phone application for hand-held devices such as PDAs. (Windows CE)

  15. Conclusion ☆ Task management is best done cooperatively, and stack management is best done automatically ; ☆ A hybrid model adapts between code with automatic and with manual stack management, enabling cooperation among disparate programmers and software evolution of disparate code bases; ☆ The hybrid approach is in fact complicated, but it is also necessary sometimes.

  16. References [1] Stephen Ferg; Event-Driven Programming: Introduction, Tutorial, history; 2006. http://eventdrivenpgm.sourceforge.net/ [2] Atul Adya, Jon Howell, Marvin Theimer, et al. Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming. Proceedings of the USENIX 2002 Annual Conference, pages 289-302, June 2002. [3] Wikipedia, the free encyclopedia; http://en.wikipedia.org/wiki/Main_Page [4] Satish Gottimukkala; Presentation of Cooperative Task Management without ManualStack Management or, Event-driven Programming is Not the Opposite of Threaded Programming; http://web.cecs.pdx.edu/~walpole/class/cs533/spring2005/slides/71.ppt

  17. Thank You !

More Related