Presenting: Why Events Are A “Bad” Idea ( for high-concurrency servers) Paper by: Behren, Condit and Brewer, 2003 Presented by: Rania Elnaggar 1/30/2008.

Slides:



Advertisements
Similar presentations
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Cooperative Task Management without Manual Stack Management or Event-driven programming is not the.
Advertisements

Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
Chess Review May 8, 2003 Berkeley, CA Compiler Support for Multithreaded Software Jeremy ConditRob von Behren Feng ZhouEric Brewer George Necula.
1 SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
1 Capriccio: Scalable Threads for Internet Services Matthew Phillips.
SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
Concurrency, Thread and Event CS6410 Sept 6, 2011 Ji-Yong Shin.
Why Events Are A Bad Idea (for high-concurrency servers) By Rob von Behren, Jeremy Condit and Eric Brewer.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
Capriccio: Scalable Threads for Internet Services ( by Behren, Condit, Zhou, Necula, Brewer ) Presented by Alex Sherman and Sarita Bafna.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
CS533 Concepts of Operating Systems Class 6 The Duality of Threads and Events.
Threads vs. Processes April 7, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
Why Events Are a Bad Idea (for high-concurrency servers) Author: Rob von Behren, Jeremy Condit and Eric Brewer Presenter: Wenhao Xu Other References: [1]
“Why Events are a Bad Idea (For high-concurrency servers)” Paper by Rob von Behren, Jeremy Condit and Eric Brewer, May 2003 Presentation by Loren Davis,
CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.
1 On the Duality of Operating System Structures Hugh Lauer, Xerox Roger Needham, Cambridge University Oct 1978, reprinted April 1979 Presented by David.
Concurrency, Threads, and Events Robbert van Renesse.
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.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer Computer Science Division, University of California.
CS 3013 & CS 502 Summer 2006 Threads1 CS-3013 & CS-502 Summer 2006.
Why Threads Are A Bad Idea (for most purposes) John Ousterhout Sun Microsystems Laboratories
Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer University of California at Berkeley
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
SEDA – Staged Event-Driven Architecture
Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer Presented by: Hisham Benotman CS533 - Concepts of.
Cooperative Task Management without Manual Stack Management Or, Event-driven Programming is not the Opposite of Thread Programming Atul Adya, John Howell,
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Dave Archer - CS533 - Spring On the Duality of Operating System Structures Hugh C. Lauer, Roger M. Needham.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Presented by Changdae Kim and Jaeung Han OFFENCE.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Concurrent Programming. Concurrency  Concurrency means for a program to have multiple paths of execution running at (almost) the same time. Examples:
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 1 On The Duality of Operating System Structures Hugh Lauer, Xerox Roger Needham, Cambridge University 1979 Presented.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
CS333 Intro to Operating Systems Jonathan Walpole.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
CSE 60641: Operating Systems Next topic: CPU (Process/threads/scheduling, synchronization and deadlocks) –Why threads are a bad idea (for most purposes).
1 Cooperative Task Management without Manual Stack Management or Event-driven Programming is not the Opposite of Threaded Programming Atul Adya, Jon Howell,
13-1 Chapter 13 Concurrency Topics Introduction Introduction to Subprogram-Level Concurrency Semaphores Monitors Message Passing Java Threads C# Threads.
Thread basics. A computer process Every time a program is executed a process is created It is managed via a data structure that keeps all things memory.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
SEDA An architecture for Well-Conditioned, scalable Internet Services Matt Welsh, David Culler, and Eric Brewer University of California, Berkeley Symposium.
Threads versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
1 Why Events Are A Bad Idea (for high-concurrency servers) By Rob von Behren, Jeremy Condit and Eric Brewer (May 2003) CS533 – Spring 2006 – DONG, QIN.
CS533 Concepts of Operating Systems Jonathan Walpole.
Brian Bershad, Thomas Anderson, Edward Lazowska, and Henry Levy Presented by: Byron Marohn Published: 1991.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
REVIEW OF “ON THE DUALITY OF OPERATING SYSTEM STRUCTURES” Paper by Hugh C. Lauer and Roger M. Needham Presentation by Erin Chapman.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
Paper Review of Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer By Anandhi Sundaram.
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Why Events Are A Bad Idea (for high-concurrency servers)
Concurrency, threads, and events
CS399 New Beginnings Jonathan Walpole.
Presenter: Godmar Back
Chapter 4: Threads.
On the Duality of Operating System Structures
Why Threads Are A Bad Idea (for most purposes)
Why Events Are a Bad Idea (for high concurrency servers)
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CS 5204 Operating Systems Lecture 5
Presentation transcript:

Presenting: Why Events Are A “Bad” Idea ( for high-concurrency servers) Paper by: Behren, Condit and Brewer, 2003 Presented by: Rania Elnaggar 1/30/2008

2Rania Elnaggar Agenda Background: What are we talking about? “Thread” of discussion – Related work Define the two models Countering criticism to threads Performance Control flow Synchronization State management Scheduling Strengths of threaded model Intrinsic properties Enabling mechanisms Implementation in Knot Conclusion & future directions

1/30/2008 3Rania Elnaggar Background

1/30/2008 4Rania Elnaggar “Thread” of discussion "Why Threads Are A Bad Idea (for most purposes)" by John Ousterhout, Talk Slides, Sun Microsystems Laboratories. September "SEDA: An Architecture for Well-Conditioned, Scalable Internet Services" Services" by Welsh, Culler, and Brewer, In Proceedings of the Eighteenth Symposium on Operating Systems Principles (SOSP-18), Banff, Canada, October, "On the Duality of Operating System Structures" by Lauer and Needham, in Proc. Second International Symposium on Operating Systems Principles, Oct Reprinted in SIGOPS Operating Systems Review, 13,2, Pages 3-19, April "Why Events Are A Bad Idea (for high-concurrency servers)" by Rob von Behren, Jeremy Condit and Eric Brewer, in proceedings HotOS IX, Kauai, Hawaii, May 2003.

1/30/2008 5Rania Elnaggar Which side is better? Is it a dichotomy? Camp ThreadsCamp Events Events are WORSE! Threads are BAD!

1/30/2008 6Rania Elnaggar Event-based model “Classic” definition: Small number of static processes Pre-defined, static communication mechanisms Address space is divided Synchronization and cooperation through message passing, therefore, known as message- passing model No “mutual” sharing of data Blocked I/O is complex to handle. Stack ripping.

1/30/2008 7Rania Elnaggar The Pseudo-concurrent model Scheduler Handler 1 Handler 2 Handler 3 Handler 4

1/30/2008 8Rania Elnaggar Thread-based model “Classic” definition: Large number of dynamic light-weight processes (i.e. threads) Classically procedure-oriented through fork and join Synchronization via shared data and interlocking. System resources encoded as global data structures and shared via locks Blocked I/O is a blocked thread. State saved in thread context.

1/30/2008 9Rania Elnaggar The Quasi-concurrent model 123n Shared resources & address space

1/30/ Rania Elnaggar Beyond the flashy titles! What it says: Why threads are a “bad” idea. What it means: Artificial concurrency is bad when not justified by need. What it says: Why events are a “bad” idea. What it means: Events are not concurrent by definition and thus unsuitable for truly concurrent systems.

1/30/ Rania Elnaggar Apples and Oranges? Same LABEL, different FORMS Super Drink DecafDietLightLemonForte

1/30/ Rania Elnaggar Critique

1/30/ Rania Elnaggar Threads exhibit poor performance Artifact of poor threading implementation. Processes that are O(n) should be eliminated Did not address context switching overhead due to preemption!

1/30/ Rania Elnaggar Threads have restrictive control flow Threads lend themselves to “linear” control flow. If the control flow is complex, it will be error- prone and difficult to implement. Call/return, parallel calls and pipelines are easily implemented with threads Dynamic fan-in and fan-out is less graceful here but not used by highly concurrent servers.

1/30/ Rania Elnaggar Thread synchronization mechanisms are heavyweight “Cooperative scheduling” is free synchronization for events Not a property of events but rather of the “cooperative scheduling” Did not counter the argument! Need to introduce lighter-weight context switches.

1/30/ Rania Elnaggar Thread stacks are poorly fitted for live state mgmt Waste address space vs. risking stack overgrowth Introduce dynamic stack growth Automatic stack management has a lot of room for waste. Compiler optimization. It shows that those shortcomings can be overturned not that they don’t exist!

1/30/ Rania Elnaggar Threads prevent optimal scheduling decision Optimized scheduling decision can be easily made for event-driven systems Ex: shortest-completion time. Better scheduling for “locality” by running same-kind events in a row. Threads can be “scheduled” cooperatively to reap the same benefits.

1/30/ Rania Elnaggar Strengths

1/30/ Rania Elnaggar Intrinsic properties Control flow Easier to understand in threads Stack ripping in events and difficulty matching calls and returns. Exception handling and state lifetime Clean-up is easier in threaded systems Heap allocation in events together with error branching in control flow makes it difficult to clean up.

1/30/ Rania Elnaggar Enabling threads Compiler support to overcome performance impediments: Dynamic stack growth Live state management Synchronization

1/30/ Rania Elnaggar Knot – How does it scale?

1/30/ Rania Elnaggar Conclusion

1/30/ Rania Elnaggar What is the “best” answer? Threads Events It depends! Yet to be found! There is no “best” answer. It is only “an” answer!

1/30/ Rania Elnaggar Future Directions CMP is mainstream True concurrency is cheap Complex specialty architectures (ex: NUMA) will be less attractive Object Oriented No distinction between data and operations Encapsulated Entities – No locking nightmares! New languages and new compilers. Hybrid models? New models?

1/30/ Rania Elnaggar Thank you for staying tuned!