TAME – Event Style Programming with Threads

Slides:



Advertisements
Similar presentations
The cardiac pacemaker – SystemJ versus Safety Critical Java Heejong Park, Avinash Malik, Muhammad Nadeem, and Zoran Salcic. University of Auckland, NZ.
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.
CS533 Concepts of Operating Systems Class 5 Integrated Task and Stack Management.
Chapter 5 Processes and Threads Copyright © 2008.
CS533 Concepts of Operating Systems Class 6 The Duality of Threads and Events.
CS533 Concepts of Operating Systems Class 20 Summary.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Business Process Orchestration
CS533 Concepts of Operating Systems Class 6 The Duality of Threads and Events.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
3.5 Interprocess Communication
Processes 1 CS502 Spring 2006 Processes Week 2 – CS 502.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
CS533 Concepts of Operating Systems Class 7 Integrated Task and Stack Management.
Concurrency, Threads, and Events Robbert van Renesse.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for Threads.
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.
1 I/O Management in Representative Operating Systems.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Implementing Processes and Process Management Brian Bershad.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Presented by Changdae Kim and Jaeung Han OFFENCE.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
A Comparative Study of the Linux and Windows Device Driver Architectures with a focus on IEEE1394 (high speed serial bus) drivers Melekam Tsegaye
COMP25212 CPU Multi Threading Learning Outcomes: to be able to: –Describe the motivation for multithread support in CPU hardware –To distinguish the benefits.
Cooperative Task Management without Manual Stack Management or, Event-driven programming is Not the Opposite of Threaded Programming Atul Adya, Jon Howell,
Lecture 8 Page 1 CS 111 Online Other Important Synchronization Primitives Semaphores Mutexes Monitors.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 14 Threads 2 Read Ch.
Cooperative Task Management without Manual Stack Management OR Presented by Tina Swenson CS533 - February 12, 2007 Event-driven Programming is Not the.
CS 838: Pervasive Parallelism Introduction to pthreads Copyright 2005 Mark D. Hill University of Wisconsin-Madison Slides are derived from online references.
Events in General. Agenda Post/wait technique I/O multiplexing Asynchronous I/O Signal-driven I/O Database events Publish/subscribe model Local vs. distributed.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
TAME Event Based Concurrency System Nabil S. Al Ramli.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
Cooperative Task Management without Manual Stack management Hanyun Tao EECS 582 – W161.
Adding Concurrency to a Programming Language Peter A. Buhr and Glen Ditchfield USENIX C++ Technical Conference, Portland, Oregon, U. S. A., August 1992.
Maxwell Krohn, Eddie Kohler, and M. Frans Kaashoek
Chapter 4 – Thread Concepts
CMSC 611: Advanced Computer Architecture
Why Events Are A Bad Idea (for high-concurrency servers)
Microprocessor Systems Design I
CS 6560: Operating Systems Design
PARALLEL PROGRAM CHALLENGES
Håkan Sundell Philippas Tsigas
Outline Other synchronization primitives
Chapter 4 – Thread Concepts
CS399 New Beginnings Jonathan Walpole.
Chapter 4: Threads.
Multithreading Tutorial
Other Important Synchronization Primitives
Capriccio – A Thread Model
CSCI 315 Operating Systems Design
Cs561 Presenter: QIAOQIAO CHEN Spring 2012
CS 143A Quiz 1 Solution.
Multithreading Tutorial
Operating System Concepts
Architectural Support for OS
Multithreading Tutorial
Jonathan Walpole Computer Science Portland State University
Multithreading Tutorial
CS510 Operating System Foundations
Architectural Support for OS
Chapter 13: I/O Systems.
CS 5204 Operating Systems Lecture 5
Threads CSE 2431: Introduction to Operating Systems
Presentation transcript:

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

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. 87-100. CS 5204 – Operating Systems

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

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

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

Tame Primitives CS 5204 – Operating Systems

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

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

Event IDs & Composability CS 5204 – Operating Systems

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

Performance (relative to Capriccio) CS 5204 – Operating Systems