Scheduler Activations On BSD: Sharing Thread Management Between Kernel and Application Christopher Small and Margo Seltzer Harvard University Presenter:

Slides:



Advertisements
Similar presentations
CS 5204 – Operating Systems 1 Scheduler Activations.
Advertisements

Lightweight Remote Procedure Call Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented by Alana Sweat.
Chapter 5 Threads os5.
Modified from Silberschatz, Galvin and Gagne ©2009 Lecture 7 Chapter 4: Threads (cont)
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.
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,
Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads.
CS533 Concepts of Operating Systems Class 5 Integrated Task and Stack Management.
Threads. Announcements Cooperating Processes Last time we discussed how processes can be independent or work cooperatively Cooperating processes can.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Solaris.
User Level Interprocess Communication for Shared Memory Multiprocessor by Bershad, B.N. Anderson, A.E., Lazowska, E.D., and Levy, H.M.
CS238 Lecture 5 Threads Dr. Alan R. Davis. Threads Definitions Benefits User and Kernel Threads Multithreading Models Solaris 2 Threads Java Threads.
Scheduler Activations Effective Kernel Support for the User-Level Management of Parallelism.
Threads vs. Processes April 7, 2000 Instructor: Gary Kimura Slides courtesy of Hank Levy.
3.5 Interprocess Communication Many operating systems provide mechanisms for interprocess communication (IPC) –Processes must communicate with one another.
Based on Silberschatz, Galvin and Gagne  2009 Threads Definition and motivation Multithreading Models Threading Issues Examples.
3.5 Interprocess Communication
Threads CSCI 444/544 Operating Systems Fall 2008.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
 2004 Deitel & Associates, Inc. All rights reserved. Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for Threads.
1 Uniprocessor Scheduling Chapter 9. 2 Aims of Scheduling Assign processes to be executed by the processor(s) Response time Throughput Processor efficiency.
4.7.1 Thread Signal Delivery Two types of signals –Synchronous: Occur as a direct result of program execution Should be delivered to currently executing.
Process Concept An operating system executes a variety of programs
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
G Robert Grimm New York University Scheduler Activations.
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.
Threads Chapter 4. Modern Process & Thread –Process is an infrastructure in which execution takes place  (address space + resources) –Thread is a program.
ThreadsThreads operating systems. ThreadsThreads A Thread, or thread of execution, is the sequence of instructions being executed. A process may have.
Scheduler Activations Jeff Chase. Threads in a Process Threads are useful at user-level – Parallelism, hide I/O latency, interactivity Option A (early.
CS 153 Design of Operating Systems Spring 2015
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Multithreading Allows application to split itself into multiple “threads” of execution (“threads of execution”). OS support for creating threads, terminating.
Silberschatz, Galvin and Gagne ©2011Operating System Concepts Essentials – 8 th Edition Chapter 4: Threads.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Threads, Thread management & Resource Management.
Operating System Concepts Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Scheduler Activations: Effective Kernel Support for the User- Level Management of Parallelism. Thomas E. Anderson, Brian N. Bershad, Edward D. Lazowska,
© 2004, D. J. Foreman 2-1 Concurrency, Processes and Threads.
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for.
Threads G.Anuradha (Reference : William Stallings)
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
1 Lecture 4: Threads Advanced Operating System Fall 2010.
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.
Multithreaded Programing. Outline Overview of threads Threads Multithreaded Models  Many-to-One  One-to-One  Many-to-Many Thread Libraries  Pthread.
Chapter 4: Multithreaded Programming. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is Thread “Thread is a part of a program.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
Chapter 4: Threads. 4.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th edition, Jan 23, 2005 Chapter 4: Threads Overview Multithreading.
Department of Computer Science and Software Engineering
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 4: Threads.
The Mach System Silberschatz et al Presented By Anjana Venkat.
Processes & Threads Introduction to Operating Systems: Module 5.
1 OS Review Processes and Threads Chi Zhang
Operating System Concepts
Lecturer 3: Processes multithreaded Operating System Concepts Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 5: Threads  Overview  Multithreading Models  Threading Issues  Pthreads.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Chapter 4 – Thread Concepts
Chapter 4: Threads.
PROCESS MANAGEMENT IN MACH
Chapter 4 – Thread Concepts
Chapter 4 Threads.
Fast Communication and User Level Parallelism
Threads and Concurrency
Threads Chapter 4.
Thomas E. Anderson, Brian N. Bershad,
CS Introduction to Operating Systems
Presentation transcript:

Scheduler Activations On BSD: Sharing Thread Management Between Kernel and Application Christopher Small and Margo Seltzer Harvard University Presenter: Bhupesh Kothari

Outline Scheduler Activation Model Implementation Performance Analysis Analytic Model Conclusions

Introduction Thread Models –kernel level threads –user level threads Scheduler Activations –proposed by Anderson T.

Processes heavy weight do not share resources communication and switching is expensive applications have no control over process scheduling

Threads lighter weight abstraction multiple threads share resources and address space communication is accomplished through shared data

Kernel Level Threads processes that share code and data space switching between them is slow application has no control over scheduling suffer from the frequent user-kernel domain crossings and fixed kernel scheduling priorities

User Level Threads implemented at application level switching between them is fast user level controls thread scheduling not integrated with the kernel

Scheduler Activations thread management between the kernel and the application application creates virtual processors application creates and schedules threads application assigns threads to virtual processors

Implementation both kernel and user level support kernel-level support implemented in BSD/386 version 1.0 user-level package:Myth

Kernel-Library Interface sfork: creates a child process sigsuspend: kernel puts the virtual processor to sleep until signal is received blocked: a thread blocks in the kernel ready: a thread is ready to run tsleep: is a process that is about to block is virtual processor?

Library-Application Interface It includes calls to –fork a child thread –join a child thread –yield the virtual processor to another thread –create and manipulate user level locks level of parallelism: mp User level scheduler selects waiting threads round-robin

Library-Application Interface th_init:initialize the thread package and creates mp-1 virtual processors th_fork(func,arg):forks a new child thread th_yield:yield the virtual processor to another thread th_join:wait for the termination of specified thread and accept its return value supports synchronization primitives:locking

System Call and Library Support only support for thread context switching is not sufficient to build multithreaded appl. some system system calls cannot be fixed. applications must be written to work around these problems or system call interface must be expanded to include new stateless calls

Performance Analysis Is it worthwhile to architect an application as a multi-threaded system? –cost time spent in initialization fork and join time context switch time per operation synchronization time –benefits possibility of increased throughput

Microbenchmark Results- Lock/Unlock

Microbenchmark Results-Fork

Microbenchmark Results-Yield

Analytic Model Reasons to use threads package –application is most naturally structured using multiple threads –threads package that run both on uniprocessors and multiprocessors –application may benefit from increased parallelism

Cost-Benefit Model Consider a scenario of Database Server: –disk requests takes 19 times longer than cache requests –cache has a 95% hit ratio Amount of time servicing disk requests: 19 x 0.05 = 0.95 Amount of time servicing cache requests: 1 x 0.95 = 0.95

Conclusions well suited for uniprocessors straightforward to implement Scheduler Activations allows application to manage its threads at user level overhead of using Scheduler Activations is less than 10% of cost of I/O