Overview of Threads and Concurrency
|
|
- Loren Matthews
- 5 years ago
- Views:
Transcription
1 CS533 Cncepts f Operating Systems Class 2 Overview f Threads and Cncurrency
2 Questins Why study threads and cncurrent prgramming in an OS class? What is a thread? Is multi-threaded prgramming easy? If nt, why nt? CS533 - Cncepts f Operating Systems 2
3 Threads Prcesses have the fllwing cmpnents: a CPU cntext r thread f cntrl an addressing cntext (address space) a cllectin f perating system state On multiprcessr systems, with several CPUs, it wuld make sense fr a prcess t have several CPU cntexts (threads f cntrl) Multiple threads f cntrl culd run in the same address space n a single CPU system t! thread f cntrl and address space are rthgnal cncepts CS533 - Cncepts f Operating Systems 3
4 Threads Threads share an address space with zer r mre ther threads culd be the kernel s address space r that f a user level prcess Threads have their wn PC, SP, register state etc (CPU state) Stack (memry) Why d these need t be private t each thread? what ther OS state shuld be private t threads? A traditinal prcess can be viewed as an address space with a single thread CS533 - Cncepts f Operating Systems 4
5 Single thread state within a prcess CS533 - Cncepts f Operating Systems 5
6 Multiple threads in an address space CS533 - Cncepts f Operating Systems 6
7 Shared state amng related threads Open files, sckets, lcks User ID, grup ID, prcess/task ID Address space Text Data (ff-stack glbal variables) Heap (dynamic data) Changes made t shared state by ne thread will be visible t the thers! Reading & writing shared memry requires synchrnizatin! CS533 - Cncepts f Operating Systems 7
8 Why prgram using threads? Utilize multiple CPU s cncurrently Lw cst cmmunicatin via shared memry Overlap cmputatin and blcking n a single CPU Blcking due t I/O Cmputatin and cmmunicatin Handle asynchrnus events CS533 - Cncepts f Operating Systems 8
9 Why use threads? - example A WWW prcess GET / HTTP/1.0 HTTPD disk CS533 - Cncepts f Operating Systems 9
10 Why use threads? - example A WWW prcess GET / HTTP/1.0 HTTPD disk Why is this nt a gd web server design? CS533 - Cncepts f Operating Systems 10
11 Why use threads? - example A WWW prcess GET / HTTP/1.0 HTTPD HTTPD disk CS533 - Cncepts f Operating Systems 11
12 Why use threads? - example A WWW prcess GET / HTTP/1.0 HTTPD GET / HTTP/1.0 disk CS533 - Cncepts f Operating Systems 12
13 Why use threads? - example A WWW prcess GET / HTTP/1.0 HTTPD GET / HTTP/1.0 GET / HTTP/1.0 GET / HTTP/1.0 disk CS533 - Cncepts f Operating Systems 13
14 What des a typical thread API lk like? POSIX standard threads (Pthreads) First thread exists in main(), typically creates the thers pthread_create (thread,attr,start_rutine,arg) Returns new thread ID in thread Executes rutine specified by start_rutine with argument specified by arg Exits n return frm rutine r when tld explicitly CS533 - Cncepts f Operating Systems 14
15 Thread API (cntinued) pthread_exit (status) Terminates the thread and returns status t any jining thread pthread_jin (threadid,status) Blcks the calling thread until thread specified by threadid terminates Return status frm pthread_exit is passed in status One way f synchrnizing between threads pthread_yield () Thread gives up the CPU and enters the run queue CS533 - Cncepts f Operating Systems 15
16 Using create, jin and exit primitives CS533 - Cncepts f Operating Systems 16
17 An example Pthreads prgram #include <pthread.h> #include <stdi.h> #define NUM_THREADS 5 vid *PrintHell(vid *threadid) { printf("\n%d: Hell Wrld!\n", threadid); pthread_exit(null); } int main (int argc, char *argv[]) { pthread_t threads[num_threads]; int rc, t; fr(t=0; t<num_threads; t++ { printf("creating thread %d\n", t); rc = pthread_create(&threads[t], NULL, PrintHell, (vid *)t); if (rc) { printf("error; return cde frm pthread_create() is %d\n", rc); exit(-1); } } pthread_exit(null); } Prgram Output Creating thread 0 Creating thread 1 0: Hell Wrld! 1: Hell Wrld! Creating thread 2 Creating thread 3 2: Hell Wrld! 3: Hell Wrld! Creating thread 4 4: Hell Wrld! Fr mre examples see: CS533 - Cncepts f Operating Systems 17
18 Prs & cns f threads Prs Cns Overlap I/O with cmputatin! Cheaper cntext switches Better mapping t shared memry multiprcessrs Ptential thread interactins due t cncurrent access t memry Cmplexity f debugging Cmplexity f multi-threaded prgramming Backwards cmpatibility with existing cde CS533 - Cncepts f Operating Systems 18
19 Cncurrent prgramming Assumptins: Example: Prblem: Tw r mre threads Each executes in (pseud) parallel and can t predict exact running speeds The threads can interact via access t shared variables One thread writes a variable The ther thread reads frm the same variable The utcme depends n the rder f these READs and WRITES! CS533 - Cncepts f Operating Systems 19
20 Race cnditins What is a race cnditin? CS533 - Cncepts f Operating Systems 20
21 Race cnditins What is a race cnditin? tw r mre threads have an incnsistent view f a shared memry regin (I.e., a variable) Why d race cnditins ccur? CS533 - Cncepts f Operating Systems 21
22 Race cnditins What is a race cnditin? tw r mre threads have an incnsistent view f a shared memry regin (I.e., a variable) Why d race cnditins ccur? values f memry lcatins are replicated in registers during executin cntext switches ccur at arbitrary times during executin (r prgram runs n a multiprcessr) threads can see stale memry values in registers CS533 - Cncepts f Operating Systems 22
23 Race Cnditins Race cnditin: whenever the utput depends n the precise executin rder f the threads! What slutins can we apply? CS533 - Cncepts f Operating Systems 23
24 Race Cnditins Race cnditin: whenever the utput depends n the precise executin rder f the threads! What slutins can we apply? prevent cntext switches by preventing interrupts? make threads crdinate with each ther t ensure mutual exclusin in accessing critical sectins f cde CS533 - Cncepts f Operating Systems 24
25 Synchrnizatin by mutual exclusin Divide thread cde int critical sectins Sectins where shared data is accessed (read/written) Only allw ne thread at a time in a critical sectin CS533 - Cncepts f Operating Systems 25
26 Critical sectins with mutual exclusin CS533 - Cncepts f Operating Systems 26
27 Hw can we ensure mutual exclusin? What abut using a binary lck variable in memry and having threads check it and set it befre entry t critical regins? CS533 - Cncepts f Operating Systems 27
28 Implementing lcks A binary lck variable in memry des nt wrk! Many cmputers have sme limited hardware supprt fr atmically testing and setting lcks Atmic Test and Set Lck instructin Atmic cmpare and swap instructin These atmic instructins can be used t implement mutual exclusin (mutex) lcks CS533 - Cncepts f Operating Systems 28
29 Test-and-set-lck instructin (TSL, tset) A lck is a single wrd variable with tw values 0 = FALSE = nt lcked 1 = TRUE = lcked The test-and-set instructin des the fllwing atmically: Get the (ld) value f lck Set the new value f lck t TRUE Return the ld value If the returned value was FALSE... Then yu gt the lck!!! If the returned value was TRUE... Then smene else has the lck (s try again later) CS533 - Cncepts f Operating Systems 29
30 Mutex lcks An abstract data type built frm the underlying atmic instructins prvided by the CPU Used fr mutual exclusin Lck (mutex) Acquire the lck, if it is free If the lck is nt free, then wait until it can be acquired Varius different ways t wait Unlck (mutex) Release the lck If there are waiting threads, then wake up ne f them CS533 - Cncepts f Operating Systems 30
31 Building spinning mutex lcks using TSL Mutex_lck: TSL REGISTER,MUTEX cpy mutex t register and set mutex t 1 CMP REGISTER,#0 was mutex zer? JZE k if it was zer, mutex is unlcked, s return JMP mutex_lck try again later Ok: RET return t caller; enter critical sectin Mutex_unlck: MOVE MUTEX,#0 RET stre a 0 in mutex return t caller CS533 - Cncepts f Operating Systems 31
32 Building yielding mutex lcks using TSL Mutex_lck: TSL REGISTER,MUTEX cpy mutex t register and set mutex t 1 CMP REGISTER,#0 was mutex zer? JZE k if it was zer, mutex is unlcked, s return CALL thread_yield mutex is busy, s schedule anther thread JMP mutex_lck try again later Ok: RET return t caller; enter critical sectin Mutex_unlck: MOVE MUTEX,#0 RET stre a 0 in mutex return t caller CS533 - Cncepts f Operating Systems 32
33 T yield r nt t yield? Spin-lcks d busy waiting wastes CPU cycles n uni-prcessrs Why? Yielding lcks give up the CPU may waste CPU cycles n multi-prcessrs Why? Yielding is nt the same as blcking! CS533 - Cncepts f Operating Systems 33
34 An Example using a Mutex Shared data: Mutex mylck; 1 repeat 2 Lck(myLck); 3 critical sectin 4 Unlck(myLck); 5 remainder sectin 6 until FALSE 1 repeat 2 Lck(myLck); 3 critical sectin 4 Unlck(myLck); 5 remainder sectin 6 until FALSE CS533 - Cncepts f Operating Systems 34
35 Enfrcing mutual exclusin Assumptins: Every thread sets the lck befre accessing shared data! Every thread releases the lck after it is dne! Only wrks if yu fllw these prgramming cnventins all the time! Thread 1 Thread 2 Thread 3 Lck Lck A = 2 A = A+1 A = A*B Unlck Unlck CS533 - Cncepts f Operating Systems 35
36 Using Pthread mutex variables Pthread_mutex_lck (mutex) Acquire the lck r blck until it is acquired Pthread_mutex_trylck (mutex) Acquire the lck r return with busy errr cde Pthread_mutex_unlck (mutex) Free the lck CS533 - Cncepts f Operating Systems 36
37 Invariant f a mutex The mutex invariant is the cnditin that must be restred befre: The mutex is released Example Invariant A=B always hlds utside the critical sectin Critical sectin updates A and B CS533 - Cncepts f Operating Systems 37
38 What des thread-safe mean? CS533 - Cncepts f Operating Systems 38
39 What des thread-safe mean? A piece f cde (library) is thread-safe if it defines critical sectins and uses synchrnizatin t cntrl access t them All entry pints must be re-entrant Results nt returned in shared glbal variables nr glbal statically allcated strage All calls shuld be synchrnus CS533 - Cncepts f Operating Systems 39
40 Reentrant cde A functin/methd is said t be reentrant if... A functin that has been invked may be invked again befre the first invcatin has returned, and will still wrk crrectly Recursive rutines are reentrant In the cntext f cncurrent prgramming... A reentrant functin can be executed simultaneusly by mre than ne thread, with n ill effects CS533 - Cncepts f Operating Systems 40
41 Reentrant Cde Cnsider this functin... var cunt: int = 0 functin GetUnique () returns int cunt = cunt + 1 return cunt endfunctin What happens if it is executed by different threads cncurrently? CS533 - Cncepts f Operating Systems 41
42 Reentrant Cde Cnsider this functin... var cunt: int = 0 functin GetUnique () returns int cunt = cunt + 1 return cunt endfunctin What happens if it is executed by different threads cncurrently? The results may be incrrect! This rutine is nt reentrant! CS533 - Cncepts f Operating Systems 42
43 When is cde reentrant? Sme variables are lcal -- t the functin/methd/rutine glbal -- smetimes called static Access t lcal variables? A new stack frame is created fr each invcatin Each thread has its wn stack What abut access t glbal variables? Must use synchrnizatin! CS533 - Cncepts f Operating Systems 43
44 Making this functin reentrant var cunt: int = 0 mylck: Mutex functin GetUnique () returns int var i: int mylck.lck() cunt = cunt + 1 i = cunt mylck.unlck() return i endfunctin CS533 - Cncepts f Operating Systems 44
45 Questin What is the difference between mutual exclusin and cnditin synchrnizatin? CS533 - Cncepts f Operating Systems 45
46 Questin What is the difference between mutual exclusin and cnditin synchrnizatin? Mutual exclusin nly ne at a time in a critical sectin Cnditin synchrnizatin wait until sme cnditin hlds befre prceeding signal when cnditin hlds s thers may prceed CS533 - Cncepts f Operating Systems 46
47 Cnditin variables Mutex lcks allw threads t synchrnize befre accessing the data Cnditin variables allw synchrnizatin based n the value f the data Used in cnjunctin with a mutex lck Allws a thread in a critical sectin t wait fr a cnditin t becme true r signal that a cnditin is true Acquire mutex lck (enter critical sectin) Blck until cnditin becmes true (frees mutex lck) Free mutex lck (leave critical sectin) CS533 - Cncepts f Operating Systems 47
48 Pthread cnditin variables pthread_cnd_wait (cnditin,mutex) Releases mutex and blcks until cnditin is signaled pthread_cnd_signal (cnditin) Signals cnditin which wakes up a thread blcked n cnditin pthread_cnd_bradcast (cnditin) Signals cnditin and wakes up all threads blcked n cnditin CS533 - Cncepts f Operating Systems 48
49 Semantics f cnditin variables Hw many blcked threads shuld be wken n a signal? Which blcked thread shuld be wken n a signal? In what rder shuld newly awken threads acquire the mutex? Shuld the signaler immediately free the mutex? If s, what if it has mre wrk t d? If nt, hw can the signaled prcess cntinue? What if signal is called befre the first wait? CS533 - Cncepts f Operating Systems 49
50 Subtle race cnditins Why des wait n a cnditin variable need t atmically unlck the mutex and blck the thread? Why des the thread need t re-lck the mutex when it wakes up frm wait? Can it assume that the cnditin it waited n nw hlds? CS533 - Cncepts f Operating Systems 50
51 Deadlck Thread A lcks mutex 1 Thread B lcks mutex 2 Thread A blcks trying t lck mutex 2 Thread B blcks trying t lck mutex 1 Can als ccur with cnditin variables Nested mnitr prblem (p. 20) CS533 - Cncepts f Operating Systems 51
52 Deadlck (nested mnitr prblem) Prcedure Get(); BEGIN LOCK a DO LOCK b DO WHILE NOT ready DO wait(b,c) END; END; END; END Get; Prcedure Give(); BEGIN LOCK a DO LOCK b DO ready := TRUE; signal(c); END; END; END Give; CS533 - Cncepts f Operating Systems 52
53 Deadlck in layered systems High layer: Lck M; Call lwer layer; Release M; Lw layer: Lck M; D wrk; Release M; return; Result thread deadlcks with itself! Layer bundaries are suppsed t be paque CS533 - Cncepts f Operating Systems 53
54 Deadlck Why is it better t have a deadlck than a race? CS533 - Cncepts f Operating Systems 54
55 Deadlck Why is it better t have a deadlck than a race? Deadlck can be prevented by impsing a glbal rder n resurces managed by mutexes and cnditin variables i.e., all threads acquire mutexes in the same rder Mutex rdering can be based n layering Allwing upcalls breaks this defense CS533 - Cncepts f Operating Systems 55
56 Pririty inversin Occurs in pririty scheduling Starvatin f high pririty threads Lw pririty thread C lcks M Medium pririty thread B pre-empts C High pririty thread A preempts B then blcks n M B resumes and enters lng cmputatin Result: C never runs s can t unlck M, therefre A never runs Slutin? pririty inheritance CS533 - Cncepts f Operating Systems 56
57 Dangers f blcking in a critical sectin Blcking while hlding M prevents prgress f ther threads that need M Blcking n anther mutex may lead t deadlck Why nt release the mutex befre blcking? Must restre the mutex invariant Must reacquire the mutex n return! Things may have changed while yu were gne CS533 - Cncepts f Operating Systems 57
58 Reader/writer lcking Writers exclude readers and writers Readers exclude writers but nt readers Example, page 15 Gd use f bradcast in ReleaseExclusive() Results in spurius wake-ups and spurius lck cnflicts Hw culd yu use signal instead? Mve signal/bradcast call after release f mutex? Advantages? Disadvantages? Can we avid writer starvatin? CS533 - Cncepts f Operating Systems 58
59 Useful prgramming cnventins All access t shared data must be ptected by a mutex All shared variables have a lck The lck is held by the thread that accesses the variable Hw can this be checked? Statically? Dynamically? CS533 - Cncepts f Operating Systems 59
60 Autmated checking f cnventins Eraser A dynamic checker that uses binary re-writing techniques Gathers an executin histry f reads, writes and lck acquisitins Evaluates cnsistency with rules Is it enugh t simply check that sme lck is held whenever a glbal variable is accessed? CS533 - Cncepts f Operating Systems 60
61 Autmated checking f cnventins Eraser desn t knw ahead f time which lcks prtect which variables It infers which lcks prtect which variables using a lck-set algrithm Assume all lcks are candidates fr a variable ( C(v) is full) Fr each access take intersectin f C(v) and lcks held by thread and make these the candidate set C(v) If C(v) becmes empty, issue warning CS533 - Cncepts f Operating Systems 61
62 Imprving the lcking discipline The standard apprach prduces many false psitives that arise due t special cases: Initializatin N need t lck if n thread has a reference yet Read sharing N need t lck if all threads are readers Reader/writer lcking Distinguish cncurrent readers frm cncurrent readers and writers CS533 - Cncepts f Operating Systems 62
63 Imprved algrithm virgin rd, wr First thread exclusive wr, new thread rd shared Mdified (race?) wr rd, new thread shared wr CS533 - Cncepts f Operating Systems 63
64 Questins Why are threads lightweight? Why assciate thread lifetime with a prcedure? Why blck instead f spin waiting fr a mutex? If a mutex is a resurce scheduling mechanism What is the resurce being scheduled? What is the scheduling plicy and where is it defined? Why d alerts result in cmplicated prgrams? What is carse-grain lcking? What effect des it have n prgram cmplexity? What effect des it have n perfrmance? CS533 - Cncepts f Operating Systems 64
65 Questins What is lck cntentin? Why is it wrse n multiprcessrs than uniprcessrs? What is the slutin? and its cst? What else might cause perfrmance t degrade when yu use multiple threads? CS533 - Cncepts f Operating Systems 65
66 Why is multi-threaded prgramming hard? Many pssible interleavings at the instructin level that make it hard t reasn abut crrectness CS533 - Cncepts f Operating Systems 66
Overview of Threads and Concurrency
CS533 Cncepts f Operating Systems Class 2 Overview f Threads and Cncurrency Questins Why study threads and cncurrent prgramming in an OS class? What is a thread? Is multi-threaded prgramming easy? If nt,
More informationCS510 Concurrent Systems Class 2. A Lock-Free Multiprocessor OS Kernel
CS510 Cncurrent Systems Class 2 A Lck-Free Multiprcessr OS Kernel The Synthesis kernel A research prject at Clumbia University Synthesis V.0 ( 68020 Uniprcessr (Mtrla N virtual memry 1991 - Synthesis V.1
More informationCSE 3320 Operating Systems Synchronization Jia Rao
CSE 3320 Operating Systems Synchrnizatin Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Recap f the Last Class Multiprcessr scheduling Tw implementatins f the ready queue
More informationCS510 Concurrent Systems Class 1a. Linux Kernel Locking Techniques
CS510 Cncurrent Systems Class 1a Linux Kernel Lcking Techniques Intr t kernel lcking techniques (Linux) Why d we need lcking in the kernel? Which prblems are we trying t slve? What implementatin chices
More informationCS4500/5500 Operating Systems Synchronization
Operating Systems Synchrnizatin Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Recap f the Last Class Multiprcessr scheduling Tw implementatins f the ready
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 Process creation in UNIX All processes have a unique process id getpid(),
More informationCS533 Concepts of Operating Systems. Jonathan Walpole
CS533 Concepts of Operating Systems Jonathan Walpole Introduction to Threads and Concurrency Why is Concurrency Important? Why study threads and concurrent programming in an OS class? What is a thread?
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 The Process Concept 2 The Process Concept Process a program in execution
More informationExperience With Processes and Monitors in Mesa
Advanced Tpics in Cmputer Systems, CS262A Prf. Eric Brewer Experience With Prcesses and Mnitrs in Mesa I. Experience With Prcesses and Mnitrs in Mesa Fcus f this paper: light-weight prcesses (threads in
More informationCSE 3320 Operating Systems Deadlock Jia Rao
CSE 3320 Operating Systems Deadlck Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Recap f the Last Class Race cnditins Mutual exclusin and critical regins Tw simple appraches
More informationCS333 Intro to Operating Systems. Jonathan Walpole
CS333 Intro to Operating Systems Jonathan Walpole Threads & Concurrency 2 Threads Processes have the following components: - an address space - a collection of operating system state - a CPU context or
More informationOperating systems. Module 7 IPC (Interprocess communication) PART I. Tami Sorgente 1
Operating systems Mdule 7 IPC (Interprcess cmmunicatin) PART I Tami Srgente 1 INTERPROCESS COMMUNICATION Prcesses within a system may be independent r cperating Cperating prcess can affect r be affected
More informationCS510 Operating System Foundations. Jonathan Walpole
CS510 Operating System Foundations Jonathan Walpole Threads & Concurrency 2 Why Use Threads? Utilize multiple CPU s concurrently Low cost communication via shared memory Overlap computation and blocking
More information- Replacement of a single statement with a sequence of statements(promotes regularity)
ALGOL - Java and C built using ALGOL 60 - Simple and cncise and elegance - Universal - Clse as pssible t mathematical ntatin - Language can describe the algrithms - Mechanically translatable t machine
More informationOperating systems. Module 15 kernel I/O subsystem. Tami Sorgente 1
Operating systems Mdule 15 kernel I/O subsystem Tami Srgente 1 SWAP SPACE MANAGEMENT Swap space can be defined as a temprary strage lcatin that is used when system s memry requirements exceed the size
More informationCS 333 Introduction to Operating Systems Class 4 Concurrent Programming and Synchronization Primitives
CS 333 Introduction to Operating Systems Class 4 Concurrent Programming and Synchronization Primitives Jonathan Walpole Computer Science Portland State University 1 What does a typical thread API look
More informationCSE 3320 Operating Systems Computer and Operating Systems Overview Jia Rao
CSE 3320 Operating Systems Cmputer and Operating Systems Overview Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Overview Recap f last class What is an perating system?
More informationConcurrent Programming
Cncurrent Prgramming Cncurrency: Crrectly and efficiently managing access t shared resurces frm mul7ple pssibly-simultaneus clients Requires crdina(n, par7cularly synchrniza7n t avid incrrect simultaneus
More informationSpin Leading OS Research Astray?
Advanced Tpics in Cmputer Systems, CS262B Prf Eric A. Brewer Spin Leading OS Research Astray? January 27, 2004 I. Extensibility, Safety and Perfrmance in the SPIN Operating System Gal: extensible OS that
More informationProject 4: System Calls 1
CMPT 300 1. Preparatin Prject 4: System Calls 1 T cmplete this assignment, it is vital that yu have carefully cmpleted and understd the cntent in the fllwing guides which are psted n the curse website:
More informationCS510 Operating System Foundations. Jonathan Walpole
CS510 Operating System Foundations Jonathan Walpole The Process Concept 2 The Process Concept Process a program in execution Program - description of how to perform an activity instructions and static
More informationComputer Organization and Architecture
Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.
More informationChapter 4 Threads. Process A. Thread2 Thread ID (TID) PC Register Set Stack. Code Section Data Section Open Files
Chapter 4 Threads Thread f Cntrl -- Fundamental Unit f CPU Utilizatin Prcess A Thread1 Thread ID (TID) PC Register Set Stack Thread2 Thread ID (TID) PC Register Set Stack Thread3 Thread ID (TID) PC Register
More informationBut for better understanding the threads, we are explaining it in the 5 states.
Life cycle f a Thread (Thread States) A thread can be in ne f the five states. Accrding t sun, there is nly 4 states in thread life cycle in java new, runnable, nn-runnable and terminated. There is n running
More informationCS4500/5500 Operating Systems Computer and Operating Systems Overview
Operating Systems Cmputer and Operating Systems Overview Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Ref. MOS4E, OS@Austin, Clumbia, UWisc Overview Recap
More informationOperating Systems Notes
Operating Systems Ntes Here are are sme rugh ntes I put tgether as part f revisin fr a uni curse. They are heavily based n the curse lecture ntes by Kevin Elphinstne and Lenid Ryzhyk. All diagramsare surced
More informationProfiling & Debugging
Prfiling & Debugging CISC 879 Tristan Vanderbruggen & Jhn Cavazs Dept f Cmputer & Infrmatin Sciences University f Delaware 1 Lecture Overview Prfiling and Debugging Why? Tls Data sets Race Cnditin and
More information1 Version Spaces. CS 478 Homework 1 SOLUTION
CS 478 Hmewrk SOLUTION This is a pssible slutin t the hmewrk, althugh there may be ther crrect respnses t sme f the questins. The questins are repeated in this fnt, while answers are in a mnspaced fnt.
More informationCSE 361S Intro to Systems Software Lab #2
Due: Thursday, September 22, 2011 CSE 361S Intr t Systems Sftware Lab #2 Intrductin This lab will intrduce yu t the GNU tls in the Linux prgramming envirnment we will be using fr CSE 361S this semester,
More informationB Tech Project First Stage Report on
B Tech Prject First Stage Reprt n GPU Based Image Prcessing Submitted by Sumit Shekhar (05007028) Under the guidance f Prf Subhasis Chaudhari 1. Intrductin 1.1 Graphic Prcessr Units A graphic prcessr unit
More informationCSE 3320 Operating Systems Page Replacement Algorithms and Segmentation Jia Rao
CSE 0 Operating Systems Page Replacement Algrithms and Segmentatin Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Recap f last Class Virtual memry Memry verlad What if the
More informationCS1150 Principles of Computer Science Methods
CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Opening Prblem Find the sum f integers frm 1 t 10, frm 20
More informationCS4500/5500 Operating Systems Processes
Operating Systems Prcesses Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Ref. MOS3E, OS@Austin, Clumbia, Rchester Recap f the Last Class Cmputer hardware
More informationContents: Module. Objectives. Lesson 1: Lesson 2: appropriately. As benefit of good. with almost any planning. it places on the.
1 f 22 26/09/2016 15:58 Mdule Cnsideratins Cntents: Lessn 1: Lessn 2: Mdule Befre yu start with almst any planning. apprpriately. As benefit f gd T appreciate architecture. it places n the understanding
More informationLink-layer switches. Jurassic Park* LANs with backbone hubs are good. LANs with backbone hubs are bad. Hubs, bridges, and switches
Link-layer switches Jurassic Park* Hubs, bridges, and switches CS4 Cmputer Netwrks Department f Cmputer Science Wellesley Cllege *A multi-tier hub design. Switches 0- LANs with backbne hubs are gd. Prvide
More informationTRAINING GUIDE. Overview of Lucity Spatial
TRAINING GUIDE Overview f Lucity Spatial Overview f Lucity Spatial In this sessin, we ll cver the key cmpnents f Lucity Spatial. Table f Cntents Lucity Spatial... 2 Requirements... 2 Setup... 3 Assign
More informationThe UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Cmp 541 Digital Lgic and Cmputer Design Spring 2016 Lab Prject (PART A): A Full Cmputer! Issued Fri 4/8/16; Suggested
More informationNVIDIA S KEPLER ARCHITECTURE. Tony Chen 2015
NVIDIA S KEPLER ARCHITECTURE Tny Chen 2015 Overview 1. Fermi 2. Kepler a. SMX Architecture b. Memry Hierarchy c. Features 3. Imprvements 4. Cnclusin 5. Brief verlk int Maxwell Fermi ~2010 40 nm TSMC (sme
More informationThese tasks can now be performed by a special program called FTP clients.
FTP Cmmander FAQ: Intrductin FTP (File Transfer Prtcl) was first used in Unix systems a lng time ag t cpy and mve shared files. With the develpment f the Internet, FTP became widely used t uplad and dwnlad
More informationCS1150 Principles of Computer Science Midterm Review
CS1150 Principles f Cmputer Science Midterm Review Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Office hurs 10/15, Mnday, 12:05 12:50pm 10/17, Wednesday
More informationMID-II Examinations April 2018 Course: B. Tech Branch:CSE Year: II. Date of Exam: AN Max.Marks 30 TIME :02:00PM TO 03:00 PM
MID-II Examinatins April 2018 Curse: B. Tech Branch:CSE Year: II Subject: OS Semester :II Date f Exam:06-04-18 AN Max.Marks 30 TIME :02:00PM TO 03:00 PM Answer ANY TWO f the fllwing 2 x 15 = 30 Marks 1.A)
More informationMemory Hierarchy. Goal of a memory hierarchy. Typical numbers. Processor-Memory Performance Gap. Principle of locality. Caches
Memry Hierarchy Gal f a memry hierarchy Memry: hierarchy f cmpnents f varius speeds and capacities Hierarchy driven by cst and perfrmance In early days Primary memry = main memry Secndary memry = disks
More informationLAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C
LAB 7 (June 29/July 4) Structures, Stream I/O, Self-referential structures (Linked list) in C Due: July 9 (Sun) 11:59 pm 1. Prblem A Subject: Structure declaratin, initializatin and assignment. Structure
More informationLab 5 Sorting with Linked Lists
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C WINTER 2013 Lab 5 Srting with Linked Lists Intrductin Reading This lab intrduces
More informationRTXC Quadros Real-time Operating System Technical Summary Quadros Systems, Inc.
RTXC Quadrs Real-time Operating System Technical Summary Quadrs Systems, Inc. Real-time Operating Systems fr Cnvergent Prcessing www.quadrs.cm RTXC Quadrs Technical Summary Table f Cntents 1 Intrductin...
More informationDistributed Data Structures xfs: Serverless Network File System
Advanced Tpics in Cmputer Systems, CS262B Prf Eric A. Brewer Distributed Data Structures xfs: Serverless Netwrk File System February 3, 2004 I. DDS Gal: new persistent strage layer that is a better fit
More informationComputer Organization and Architecture
Campus de Gualtar 4710-057 Braga UNIVERSIDADE DO MINHO ESCOLA DE ENGENHARIA Departament de Infrmática Cmputer Organizatin and Architecture 5th Editin, 2000 by William Stallings Table f Cntents I. OVERVIEW.
More informationFIT 100. Lab 10: Creating the What s Your Sign, Dude? Application Spring 2002
FIT 100 Lab 10: Creating the What s Yur Sign, Dude? Applicatin Spring 2002 1. Creating the Interface fr SignFinder:... 1 2. Creating Variables t hld values... 4 3. Assigning Values t Variables... 4 4.
More informationIt has hardware. It has application software.
Q.1 What is System? Explain with an example A system is an arrangement in which all its unit assemble wrk tgether accrding t a set f rules. It can als be defined as a way f wrking, rganizing r ding ne
More informationCSE3320 Operating Systems Processes Jia Rao
CSE3320 Operating Systems Prcesses Jia Ra Department f Cmputer Science and Engineering http://ranger.uta.edu/~jra Recap f the Last Class Cmputer hardware Time-sharing Space-sharing Characteristics } Lcality,
More informationCS1150 Principles of Computer Science Methods
CS1150 Principles f Cmputer Science Methds Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Passing Parameters public static vid nprintln(string message,
More informationUsing the Swiftpage Connect List Manager
Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts
More informationOPERATING SYSTEMS B.TECH CSE III YEAR I SEMESTER (JNTUA-R13) Mrs. N.HEMALATHA ASST.PROFESSOR
LECTURE NOTES ON OPERATING SYSTEMS B.TECH CSE III YEAR I SEMESTER (JNTUA-R13) Mrs. N.HEMALATHA ASST.PROFESSOR DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING CHADALAWADA RAMANAMMA ENGINEERING COLLEGE CHADALAWADA
More informationCustodial Integrator. Release Notes. Version 3.11 (TLM)
Custdial Integratr Release Ntes Versin 3.11 (TLM) 2018 Mrningstar. All Rights Reserved. Custdial Integratr Prduct Versin: V3.11.001 Dcument Versin: 020 Dcument Issue Date: December 14, 2018 Technical Supprt:
More informationPOSIX Threads Programming. Table of Contents
POSIX Threads Prgramming Table f Cntents 1. Pthreads Overview 1. What is a Thread? 2. What are Pthreads? 3. Why Pthreads? 4. Designing Threaded Prgrams 2. The Pthreads API 3. Cmpiling Threaded Prgrams
More informationLab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 1 - Calculatr Intrductin In this lab yu will be writing yur first
More informationSummary. Server environment: Subversion 1.4.6
Surce Management Tl Server Envirnment Operatin Summary In the e- gvernment standard framewrk, Subversin, an pen surce, is used as the surce management tl fr develpment envirnment. Subversin (SVN, versin
More informationInfrastructure Series
Infrastructure Series TechDc WebSphere Message Brker / IBM Integratin Bus Parallel Prcessing (Aggregatin) (Message Flw Develpment) February 2015 Authr(s): - IBM Message Brker - Develpment Parallel Prcessing
More informationLaboratory #13: Trigger
Schl f Infrmatin and Cmputer Technlgy Sirindhrn Internatinal Institute f Technlgy Thammasat University ITS351 Database Prgramming Labratry Labratry #13: Trigger Objective: - T learn build in trigger in
More informationCS4500/5500 Operating Systems Page Replacement Algorithms and Segmentation
Operating Systems Page Replacement Algrithms and Segmentatin Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang UC. Clrad Springs Ref. MOSE, OS@Austin, Clumbia, Rchester Recap f
More information$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as:
Lcatin f the map.x.prperties files $ARCSIGHT_HOME/current/user/agent/map File naming cnventin The files are named in sequential rder such as: Sme examples: 1. map.1.prperties 2. map.2.prperties 3. map.3.prperties
More informationEView/400i Management Pack for Systems Center Operations Manager (SCOM)
EView/400i Management Pack fr Systems Center Operatins Manager (SCOM) Cncepts Guide Versin 7.0 July 2015 1 Legal Ntices Warranty EView Technlgy makes n warranty f any kind with regard t this manual, including,
More informationThe UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Yu will learn the fllwing in this lab: The UNIVERSITY f NORTH CAROLINA at CHAPEL HILL Designing a mdule with multiple memries Designing and using a bitmap fnt Designing a memry-mapped display Cmp 541 Digital
More informationOn the road again. The network layer. Data and control planes. Router forwarding tables. The network layer data plane. CS242 Computer Networks
On the rad again The netwrk layer data plane CS242 Cmputer Netwrks The netwrk layer The transprt layer is respnsible fr applicatin t applicatin transprt. The netwrk layer is respnsible fr hst t hst transprt.
More informationINSTALLING CCRQINVOICE
INSTALLING CCRQINVOICE Thank yu fr selecting CCRQInvice. This dcument prvides a quick review f hw t install CCRQInvice. Detailed instructins can be fund in the prgram manual. While this may seem like a
More informationData Structure Interview Questions
Data Structure Interview Questins A list f tp frequently asked Data Structure interview questins and answers are given belw. 1) What is Data Structure? Explain. Data structure is a way that specifies hw
More informationUsing the Swiftpage Connect List Manager
Quick Start Guide T: Using the Swiftpage Cnnect List Manager The Swiftpage Cnnect List Manager can be used t imprt yur cntacts, mdify cntact infrmatin, create grups ut f thse cntacts, filter yur cntacts
More informationIteration Part 2. Review: Iteration [Part 1] Flow charts for two loop constructs. Review: Syntax of loops. while continuation_condition : statement1
Review: Iteratin [Part 1] Iteratin Part 2 CS111 Cmputer Prgramming Department f Cmputer Science Wellesley Cllege Iteratin is the repeated executin f a set f statements until a stpping cnditin is reached.
More informationUiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash
UiPath Autmatin Walkthrugh Walkthrugh Calculate Client Security Hash Walkthrugh Calculate Client Security Hash Start with the REFramewrk template. We start ff with a simple implementatin t demnstrate the
More informationOpenSceneGraph Tutorial
OpenSceneGraph Tutrial Michael Kriegel & Meiyii Lim, Herit-Watt University, Edinburgh February 2009 Abut Open Scene Graph: Open Scene Graph is a mdern pen surce scene Graph. Open Scene Graph (r shrt OSG)
More informationRISKMAN REFERENCE GUIDE TO USER MANAGEMENT (Non-Network Logins)
Intrductin This reference guide is aimed at managers wh will be respnsible fr managing users within RiskMan where RiskMan is nt cnfigured t use netwrk lgins. This guide is used in cnjunctin with the respective
More informationBeyond Verification. Software Synthesis
Beynd Verificatin Sftware Synthesis 1 What d we mean by synthesis We want t get cde frm high-level specs - Pythn and VB are pretty high level, why is that nt synthesis? Supprt cmpsitinal and incremental
More informationLab 0: Compiling, Running, and Debugging
UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2012 Lab 0: Cmpiling, Running, and Debugging Intrductin Reading This is the
More informationRelational Operators, and the If Statement. 9.1 Combined Assignments. Relational Operators (4.1) Last time we discovered combined assignments such as:
Relatinal Operatrs, and the If Statement 9/18/06 CS150 Intrductin t Cmputer Science 1 1 9.1 Cmbined Assignments Last time we discvered cmbined assignments such as: a /= b + c; Which f the fllwing lng frms
More informationPlease contact technical support if you have questions about the directory that your organization uses for user management.
Overview ACTIVE DATA CALENDAR LDAP/AD IMPLEMENTATION GUIDE Active Data Calendar allws fr the use f single authenticatin fr users lgging int the administrative area f the applicatin thrugh LDAP/AD. LDAP
More informationC pointers. (Reek, Ch. 6) 1 CS 3090: Safety Critical Programming in C
C pinters (Reek, Ch. 6) 1 Review f pinters A pinter is just a memry lcatin. A memry lcatin is simply an integer value, that we interpret as an address in memry. The cntents at a particular memry lcatin
More informationSoftware Toolbox Extender.NET Component. Development Best Practices
Page 1 f 16 Sftware Tlbx Extender.NET Cmpnent Develpment Best Practices Table f Cntents Purpse... 3 Intended Audience and Assumptins Made... 4 Seeking Help... 5 Using the ErrrPrvider Cmpnent... 6 What
More informationTekmos. TK68020 Microprocessor. Features. General Description. 9/03/14 1
Tekms TK68020 Micrprcessr September 3, 2014 Prduct Overview Features Addressing Mde Extensins fr Enhanced Supprt f High-Level Languages Object-Cde Cmpatible with Earlier M68000 Micrprcessrs Addressing
More informationMcGill University School of Computer Science COMP-206. Software Systems. Due: September 29, 2008 on WEB CT at 23:55.
Schl f Cmputer Science McGill University Schl f Cmputer Science COMP-206 Sftware Systems Due: September 29, 2008 n WEB CT at 23:55 Operating Systems This assignment explres the Unix perating system and
More informationYou may receive a total of two GSA graduate student grants in your entire academic career, regardless of what program you are currently enrolled in.
GSA Research Grant Applicatin GUIDELINES & INSTRUCTIONS GENERAL INFORMATION T apply fr this grant, yu must be a GSA student member wh has renewed r is active thrugh the end f the award year (which is the
More informationProgramming Project: Building a Web Server
Prgramming Prject: Building a Web Server Submissin Instructin: Grup prject Submit yur cde thrugh Bb by Dec. 8, 2014 11:59 PM. Yu need t generate a simple index.html page displaying all yur grup members
More informationLog shipping is a HA option. Log shipping ensures that log backups from Primary are
LOG SHIPPING Lg shipping is a HA ptin. Lg shipping ensures that lg backups frm Primary are cntinuusly applied n standby. Lg shipping fllws a warm standby methd because manual prcess is invlved t ensure
More informationAscii Art Capstone project in C
Ascii Art Capstne prject in C CSSE 120 Intrductin t Sftware Develpment (Rbtics) Spring 2010-2011 Hw t begin the Ascii Art prject Page 1 Prceed as fllws, in the rder listed. 1. If yu have nt dne s already,
More informationSOLA and Lifecycle Manager Integration Guide
SOLA and Lifecycle Manager Integratin Guide SOLA and Lifecycle Manager Integratin Guide Versin: 7.0 July, 2015 Cpyright Cpyright 2015 Akana, Inc. All rights reserved. Trademarks All prduct and cmpany names
More informationCS1150 Principles of Computer Science Loops
CS1150 Principles f Cmputer Science Lps Yanyan Zhuang Department f Cmputer Science http://www.cs.uccs.edu/~yzhuang CS1150 UC. Clrad Springs Annuncement HW1 graded HW2 due tnight HW3 will be psted sn Due
More informationIT Essentials (ITE v6.0) Chapter 5 Exam Answers 100% 2016
IT Essentials (ITE v6.0) Chapter 5 Exam Answers 100% 2016 1. What are tw functins f an perating system? (Chse tw.) cntrlling hardware access managing applicatins text prcessing flw chart editing prgram
More informationEuropean Component Oriented Architecture (ECOA ) Collaboration Programme: Architecture Specification Part 3: Mechanisms
Eurpean Cmpnent Oriented Architecture (ECOA ) Cllabratin Prgramme: Architecture Specificatin Part 3: Mechanisms BAE Ref N: IAWG-ECOA-TR-007 Dassault Ref N: DGT 144482-F Issue: 6 Prepared by BAE Systems
More informationChapter-10 INHERITANCE
Chapter-10 INHERITANCE Intrductin: Inheritance is anther imprtant aspect f bject riented prgramming. C++ allws the user t create a new class (derived class) frm an existing class (base class). Inheritance:
More informationMIPS Architecture and Assembly Language Overview
MIPS Architecture and Assembly Language Overview Adapted frm: http://edge.mcs.dre.g.el.edu/gicl/peple/sevy/architecture/mipsref(spim).html [Register Descriptin] [I/O Descriptin] Data Types and Literals
More informationEastern Mediterranean University School of Computing and Technology Information Technology Lecture2 Functions
Eastern Mediterranean University Schl f Cmputing and Technlgy Infrmatin Technlgy Lecture2 Functins User Defined Functins Why d we need functins? T make yur prgram readable and rganized T reduce repeated
More informationUiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash
UiPath Autmatin Walkthrugh Walkthrugh Calculate Client Security Hash Walkthrugh Calculate Client Security Hash Start with the REFramewrk template. We start ff with a simple implementatin t demnstrate the
More informationCMU 15-7/381 CSPs. Teachers: Ariel Procaccia Emma Brunskill (THIS TIME) With thanks to Ariel Procaccia and other prior instructions for slides
CMU 15-7/381 CSPs Teachers: Ariel Prcaccia Emma Brunskill (THIS TIME) With thanks t Ariel Prcaccia and ther prir instructins fr slides Class Scheduling Wes 4 mre required classes t graduate A: Algrithms
More informationARM Programmer s Model
ARM Prgrammer s Mdel Hsung-Pin Chang Department f Cmputer Science Natinal Chung Hsing University PDF created with FinePrint pdffactry Pr trial versin www.pdffactry.cm Outline ARM Data Types ARM Prcessr
More informationDue Date: Lab report is due on Mar 6 (PRA 01) or Mar 7 (PRA 02)
Lab 3 Packet Scheduling Due Date: Lab reprt is due n Mar 6 (PRA 01) r Mar 7 (PRA 02) Teams: This lab may be cmpleted in teams f 2 students (Teams f three r mre are nt permitted. All members receive the
More informationOverview. Enhancement for Policy Configuration Module
Overview Digital File Plicy Management: Cnfiguratin Mdule Enhancement and Inter-applicatin Plicy Sharing Digital file plicies determine hw digital files are prcessed befre being depsited int RUcre repsitry.
More informationCS602 Computer Graphics Mid Term Examination February 2005 Time Allowed: 90 Minutes.
WWW.VUTUBE.EDU.PK www.vustuff.cm CS602 Cmputer Graphics Mid Term Examinatin February 2005 Time Allwed: 90 Minutes Instructins Please read the fllwing instructins carefully befre attempting any questin:
More informationModule: Items in DSpace
Mdule: Items in DSpace Mdule verview: Items are ne f the cre cncepts in DSpace. An item a representatin f the files and metadata bught tgether t make an atmic unit. This mdule intrduces items and the cnstituent
More informationCOP2800 Homework #3 Assignment Spring 2013
YOUR NAME: DATE: LAST FOUR DIGITS OF YOUR UF-ID: Please Print Clearly (Blck Letters) YOUR PARTNER S NAME: DATE: LAST FOUR DIGITS OF PARTNER S UF-ID: Please Print Clearly Date Assigned: 15 February 2013
More information1 Binary Trees and Adaptive Data Compression
University f Illinis at Chicag CS 202: Data Structures and Discrete Mathematics II Handut 5 Prfessr Rbert H. Slan September 18, 2002 A Little Bttle... with the wrds DRINK ME, (r Adaptive data cmpressin
More informationSystems & Operating Systems
McGill University COMP-206 Sftware Systems Due: Octber 1, 2011 n WEB CT at 23:55 (tw late days, -5% each day) Systems & Operating Systems Graphical user interfaces have advanced enugh t permit sftware
More information