Capriccio – A Thread Model

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
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 Capriccio: Scalable Threads for Internet Services Matthew Phillips.
Day 10 Threads. Threads and Processes  Process is seen as two entities Unit of resource allocation (process or task) Unit of dispatch or scheduling (thread.
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.
Processes CSCI 444/544 Operating Systems Fall 2008.
Capriccio: Scalable Threads for Internet Services (von Behren) Kenneth Chiu.
Capriccio: Scalable Threads For Internet Services Authors: Rob von Behren, Jeremy Condit, Feng Zhou, George C. Necula, Eric Brewer Presentation by: Will.
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.
Chapter 5: Memory Management Dhamdhere: Operating Systems— A Concept-Based Approach Slide No: 1 Copyright ©2005 Memory Management Chapter 5.
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
Threads, Thread management & Resource Management.
Implementing Processes and Process Management Brian Bershad.
Concurrent Programming. Concurrency  Concurrency means for a program to have multiple paths of execution running at (almost) the same time. Examples:
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
CE Operating Systems Lecture 7 Threads & Introduction to CPU Scheduling.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
Department of Computer Science and Software Engineering
Capriccio: Scalable Threads for Internet Service
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
Holistic Systems Programming Qualifying Exam Presentation UC Berkeley, Computer Science Division Rob von Behren June 21, 2004.
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.
Paper Review of Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer By Anandhi Sundaram.
Beyond Application Profiling to System Aware Analysis Elena Laskavaia, QNX Bill Graham, QNX.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
W4118 Operating Systems Instructor: Junfeng Yang.
Capriccio:Scalable Threads for Internet Services
Processes and threads.
Capriccio : Scalable Threads for Internet Services
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Why Events Are A Bad Idea (for high-concurrency servers)
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Operating Systems (CS 340 D)
Sujata Ray Dey Maheshtala College Computer Science Department
Outline Paging Swapping and demand paging Virtual memory.
Processes and Threads Processes and their scheduling
OPERATING SYSTEMS CS3502 Fall 2017
Day 12 Threads.
Chapter 2 Scheduling.
Presenter: Godmar Back
Operating Systems (CS 340 D)
Arrays and Linked Lists
CPU Scheduling G.Anuradha
Lecture Topics: 11/1 General Operating System Concepts Processes
Threads and Concurrency
Threads Chapter 4.
Processes Hank Levy 1.
CSE 451: Operating Systems Autumn 2005 Memory Management
Sujata Ray Dey Maheshtala College Computer Science Department
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Why Threads Are A Bad Idea (for most purposes)
CSE 451: Operating Systems Autumn 2003 Lecture 9 Memory Management
Why Events Are a Bad Idea (for high concurrency servers)
Processes Hank Levy 1.
Chapter 3: Processes Process Concept Process Scheduling
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CS703 – Advanced Operating Systems
CSC Multiprocessor Programming, Spring, 2011
CS Introduction to Operating Systems
Presentation transcript:

Capriccio – A Thread Model Threads vs. Events Capriccio – A Thread Model 5204 – Operating Systems

Two approaches Capriccio Seda Each service request bound to an independent thread Each thread executes all stages of the computation Seda Each thread bound to one stage of the computation Each service request proceeds through successive stages CS 5204 – Operating Systems

Philosophy Techniques Tools Capriccio Thread model is useful Improve implementation to remove barriers to scalability Techniques User-level threads Linked stack management Resource aware scheduling Tools Compiler-analysis Run-time monitoring CS 5204 – Operating Systems

Capriccio – user level threads scheduler Capriccio kernel asynch I/O polling scheduler Capriccio kernel yield User-level threading with fast context switch Cooperative scheduling (via yielding) Thread management costs independent of number of threads (except for sleep queue) Intercepts and converts blocking I/O into asynchronous I/O Does polling to determine I/O completion CS 5204 – Operating Systems

Compiler Analysis - Checkpoints Call graph – each node is a procedure annotated with maximum stack size needed to execute that procedure; each edge represents a call Maximum stack size for thread executing call graph cannot be determined statically Recursion (cycles in graph) Sub-optimal allocation (different paths may require substantially different stack sizes) Insert checkpoints to allocate additional stack space (“chunk”) dynamically On entry (e.g., CO) On each back-edge (e.g. C1) On each edge where the needed (maximum) stack space to reach a leaf node or the next checkpoints exceeds a given limit (MaxPath) (e.g., C2 and C3 if limit is 1KB) Checkpoint code added by source-source translation CS 5204 – Operating Systems

Linked Stacks Thread stack is collection of non-contiguous blocks (‘chunks”) MinChunk: smallest stack block allocated Stack blocks “linked” by saving stack pointer for “old” block in field of “new” block; frame pointer remains unchanged Two kinds of wasted memory Internal (within a block) (yellow) External (in last block) (blue) Two controlling parameters MaxPath: tradeoff between amount of instrumentation and run-time overhead vs. internal memory waste MinChunk: tradeoff between internal memory waste and external memory waste Memory advantages Avoids pre-allocation of large stacks Improves paging behavior by (1) leveraging LIFO stack usage pattern to share chunks among threads and (2) placing multiple chunks on the same page A C main B CS 5204 – Operating Systems

Resource-aware scheduling Blocking graph Nodes are points where the program blocks Arcs connect successive blocking points Blocking graph formed dynamically Appropriate for long-running program (e.g. web servers) Scheduling annotations Edge – exponentially weighted average resource usage Node – weighted average of its edge values (average resource usage of next edge) Resources – CPU, memory, stack, sockets Resource-aware scheduling: Dynamically prioritize nodes/threads based on whether the thread will increase or decrease its use of each resource When a resource is scarce, schedule threads that release that resource Limitations Difficult to determine the maximum capacity of a resource Application-managed resources cannot be seen Applications that do not yield CS 5204 – Operating Systems

Performance comparison Apache – standard distribution Haboob – event-based web server Knot – simple, threaded specially developed web server CS 5204 – Operating Systems