Class Note for CMPSCI 377 at UMass(6)
Class Note for CMPSCI 377 at UMass(6)
Popular in Course
Popular in Department
This 3 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Massachusetts taught by a professor in Fall. Since its upload, it has received 14 views.
Reviews for Class Note for CMPSCI 377 at UMass(6)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
CMPSCI 377 Operating Systems Lecturer Emery Berger Fall 2005 Lecture 5 September 27 Scribe Gallo Asztalos Kat Reagan Today 0 Intro to threads and their distinctionrelation to a process 51 Threads 511 Threads and Processes Threads are a subclass of processes ProcessRecall ls a unit of execution Control7 address space7 resources Call fork to create Thread Control only aka pc7 stack7 registers Created With pthreadcreateO A process can contain many threads becuase threads are ner grainsee below Threads communicate through memory yielding fastest possible communication De nition Granularity description of size Fine grain small7 coarse grain large 512 Thread System HistoryEvolution MSDos No threads One process ResultNothing could be done simultaneously Forced to wait for termination of process even for simple lO Embedded Systems One process Many threads ResultGood structure for these systems for there are usually many events to recognize but very simple responses Unix7 Ultrix7 MacOSpreX Many processes 51 At most one thread per process ResultFinally your 8 mhz cpu could run more than one process but these processes could not do much at once Today Many processes Each with many threads ResultYour disk can7t keep up with the processor 513 Types of Threads Kernel Threads Light weight processes Scheduled by OS Context switch required lnvolves the OS meaning time sharingquantas Result Can be scheduled on multiple processors Threads can mask latency Because don7t block on 10 aka waiting to read from device Can be slow but still faster than processes UserLevel Threads Zero OS invlolvement Process containing thread is all that is known ex java green threads Threads have own scheduler No context switch Result Flexible easy scheduling No system calls fast Requires cooperative threads One uncoooperative thread can take over OS only sees processes not threads Threads block on 10 Restricted to one processor Hybird Method Uses mapping to separate and abstract Kernel Thread LWP s user lever threads Result If there is a fault in user level thread like a block on 10 it creates another LWP to handle the thread This however requires load balancingsee below Best of both worlds but never made it due to confussions Load Balancing there are numerous processes on many processors each with many threads on todays machines How can we best distribute the workload in the form of these threads between the processes Lecture 5 September 27 Lecture 5 September 27 1 Collect all threads and distribute This doesn7t work because the processes are on more than one core 2 Work Sharing if a process has too many threads it looks for a thread to share the work with This causes problems because processes spend time looking instead of running and little to no work is done 3 Work Stealing if a process reaches a idle state it looks for a peer to take extra work fromi This is the obVious optimal solution for work is always being done
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'