Cooperative Task Management without Manual Stack Management or, Event-driven programming is Not the Opposite of Threaded Programming Atul Adya, Jon Howell,

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Cooperative Task Management without Manual Stack Management or Event-driven programming is not the.
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
CS533 Concepts of Operating Systems Class 5 Integrated Task and Stack Management.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming Atul Adya, Jon Howell,
CS533 Concepts of Operating Systems Class 6 The Duality of Threads and Events.
UCoM Software Architecture Universal Communicator Research UCoM Programming Model The Problem  Multi-threaded code is difficult to write.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Operating Systems Lecture # 3. Recap Hardware Operating System Application System Call Trap Hardware Trap Processor.
CS533 Concepts of Operating Systems Class 7 Integrated Task and Stack Management.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
CS533 Concepts of Operating Systems Class 3 Integrated Task and Stack Management.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
CS 3013 & CS 502 Summer 2006 Threads1 CS-3013 & CS-502 Summer 2006.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Cooperative Task Management without Manual Stack Management Or, Event-driven Programming is not the Opposite of Thread Programming Atul Adya, John Howell,
Chapter 3 Operating Systems Introduction to CS 1 st Semester, 2015 Sanghyun Park.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Processes & Threads Bahareh Goodarzi. Single & Multiple Thread of control code files data code files data.
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
1 Threads, SMP, and Microkernels Chapter Multithreading Operating system supports multiple threads of execution within a single process MS-DOS.
Operating Systems 1 K. Salah Module 1.2: Fundamental Concepts Interrupts System Calls.
Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Software Transactional Memory Should Not Be Obstruction-Free Robert Ennals Presented by Abdulai Sei.
CSE 60641: Operating Systems Next topic: CPU (Process/threads/scheduling, synchronization and deadlocks) –Why threads are a bad idea (for most purposes).
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
1 Cooperative Task Management without Manual Stack Management or Event-driven Programming is not the Opposite of Threaded Programming Atul Adya, Jon Howell,
Atul Adya, Jon Howell, Marvin Theimer, William J. Bolosky, John R. Douceur Microsoft Research Presented by Poonam Singh CS 533 – Winter 2010.
Palm OS CS 450 Section 3 Jason Kelske Matthew Jennings Stephen Jou Allan Topp Graham Kerster.
CS533 Concepts of Operating Systems Jonathan Walpole.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
Saurav Karmakar. Chapter 4: Threads  Overview  Multithreading Models  Thread Libraries  Threading Issues  Operating System Examples  Windows XP.
Cooperative Task Management without Manual Stack management Hanyun Tao EECS 582 – W161.
Operating System Concepts
1 Threads, SMP, and Microkernels Chapter 4. 2 Process Resource ownership - process includes a virtual address space to hold the process image Scheduling/execution-
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Processes Chapter 3. Processes in Distributed Systems Processes and threads –Introduction to threads –Distinction between threads and processes Threads.
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Introduction to Operating Systems Concepts
Chapter 4 – Thread Concepts
Introduction to threads
OPERATING SYSTEM CONCEPT AND PRACTISE
Processes and threads.
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
CS 6560: Operating Systems Design
OPERATING SYSTEMS CS3502 Fall 2017
Chapter 4 – Thread Concepts
Chapter 5: Threads Overview Multithreading Models Threading Issues
Chapter 4 Threads.
Threads and Cooperation
Threads & multithreading
Operating System Concepts
Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming Atul Adya, Jon Howell,
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Threads Chapter 4.
CHAPTER 4:THreads Bashair Al-harthi OPERATING SYSTEM
Multithreaded Programming
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
Threads CSE 2431: Introduction to Operating Systems
CS Introduction to Operating Systems
Presentation transcript:

Cooperative Task Management without Manual Stack Management or, Event-driven programming is Not the Opposite of Threaded Programming Atul Adya, Jon Howell, Marvin Theimer, William J. Bolosky, John R. Douceur Microsoft Research Presented by: Yujing He ( ) CS 533-April 24 th, 2006

Event-Driven Programming

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;

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

Concepts Relations

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

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;

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)

Manual Calling Automatic FetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

Automatic Calling Manual FetchCert—fetches a security certificate using “GetCertData” and then calls “VerifyCert” in order to confirm its validity;

Automatic Calling Manual Short Circuit Branch No I/O Block

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)

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.

References [1] Stephen Ferg; Event-Driven Programming: Introduction, Tutorial, history; [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 , June [3] Wikipedia, the free encyclopedia; [4] Satish Gottimukkala; Presentation of Cooperative Task Management without Manual Stack Management or, Event-driven Programming is Not the Opposite of Threaded Programming;

17 Thank You !