Home
dBug User Manual - School of Computer Science
Contents
1. EXPLORER Waiting for the test to finish Critical section slave Critical section master EXPLORER Waiting for the arbiter to finish This means that the explorer explored two possible ways in which the binary example 2 could have executed When the explorer starts it creates the dbug logs directory This directory is gradually populated with information about the different executions of the test Namely for each iteration the dbug logs directory contains the strategy the strategy file that the arbiter initially followed the history the history file of the execution the arbiter explored and detailed logs of the arbiter the dbug server file and the interposition layer divided into the dbug interposition and dbug client files For example the strategy file for the second iteration of the above application of the explorer looks as follows 2 1 1 2 2 The first line identifies the number n of steps of the execution specified by the strategy Each of the following n lines then identifies the thread to be proceed and the total number pending calls at that point The history file for the first iteration of the above application of explorer looks as follows dd pthread_mutex_init RESOURCE_CREATE 1 O O O O O O O 0 1759016536 2 2 pthread_mutex_lock RESOURCE_ACCESS 2 0 pthread_mutex_lock RESOURCE_ACCESS 1 1 12 pthread mutex unlock RESOURCE RELEASE 3 O O O O O O 0 0 1759016536 pthread mutex lock RESOURCE ACCESS 1 1 0
2. OO DO O RUN F 4 the Ruby Tree gem and 5 Thrift http thrift apache org Boost Ruby and Ruby Gems are available as a package for most distributions For example on Ubuntu you can install these using sudo apt get install libboost dev libboost doc ruby full rubygems sudo gem install rubytree However Thrift needs to be installed manually and it is best to follow the online tutorial After you have successfully installed the above run the following commands from the dBug root directory mkdir build cd build configure with boost BOOST_PREFIX with thrift THRIFT PREFIX make sudo make install where BOOST_PREFIX and THRIFT PREFIX is the prefix of the Boost and Thrift installation re spectively 5 Examples In the rest of the section we assume that DBUG DIR refers to the dBug distribution directory dBug is installed on your machine and DBUG PREFIX is the prefix of dBug installation 5 1 Sequential Example Interactive Mode We start with an example which runs the arbiter in the interactive mode In this mode the user is responsible for guiding the execution of the distributed and multi threaded program Conceptually running the arbiter in the interactive mode corresponds to running each process of the system in gdb which has breakpoints set for select coordination and communication library calls The program used in this example is listed below and can be found in DBUG DIR tutorial example 1
3. 2 Action RESOURCE ACCESS RESOURCE m q 3 12 Thread 1 Thread 2 atin RESOURCE_RELEASE Action RESOURCE RELEASE tina s aes TA a SS pan m 13 Tr 2 Thread 1 N Action RESOURCE ACCESS Action RESOURCE ACCESS m ear eae s E A 1 5 4 Thread 2 Thread 1 Zm RESOURCE RELEASE Action RESOURCE RELEASE din EB e E ji e NT 6 ee Thread 1 Thread 1 Nin THREAD M Action THREAD jon sp sa n Three 1 hres 1 Action RESOUACE DELETE Action RESOURCE DELETE 4 e wane a Uy Figure 3 Decision Tree 4The dot tool is part of the graph visualization suite GraphViz by AT amp T CONDOTKRWNH 5 4 Concurrent Example Deadlock In this example we introduce a deadlock into the previous program We illustrate how the explorer aids us in detecting this error and identifies the sequence of events that leads to the deadlock The program used in this example is listed below and can be found in DBUG_DIR tutorial example 3 c include lt assert h gt include lt pthread h gt include lt stdio h gt pthread_mutex_t mutexi mutex2 void thread void args assert pthread_mutex_lock amp mutex1 0 assert pthread_mutex_lock amp mutex2 0 printf Critical section slave n assert pthread_mutex_unlock amp mutex2 0 assert pthread mutex unlock kmutex1 0 return NULL int main int argc char argv pthread_t tid
4. 0 0 O O O 0 1759016536 2 1 2 pthread mutex lock RESOURCE ACCESS 1 1 0 0 0 O O O 0 1759016536 2 0 00 0 00 oo 0 0 0 1759016536 2 0 00 1759016536 2 NUNNRPRFPNRPRP RB 1 pthread join THREAD JOIN 4 O 0 0 0 0 O 0 0 2 2 12 2 pthread mutex unlock RESOURCE RELEASE 1 2 00 00 0 0 0 1759016536 1 pthread join THREAD JOIN 4 O 0 0 0 0 0 0 0 2 1 1 1 1 pthread_join THREAD_JOIN 4 0 0 0 0 0 0 0 0 2 1 1 1 1 pthread_mutex_destroy RESOURCE_DELETE 5 2 O O O O O O 0 1759016536 The first line identifies 1 the thread whose call was executed 2 the number m of threads whose call could have been executed and 3 the number n of threads with a pending call This line is then followed with n lines one per each pending call Each of these lines starts with a thread ID followed by a name of the function call and additional information which will not be explained in this example Also besides the logs directory the explorer creates the tree dot file This file can be processed by the dot tool to produce a visualization of the decision tree that the explorer created for instance by running dot T pdf o lt output_name gt tree dot The decision tree created by the above application of the explorer is depicted in Figure 3 The gray nodes and edges correspond to pending calls that cannot be completed from the current state of the system ates read 0 Action INIT Thread 1 on RESOURCE CREATE Acti meest 1 Thread
5. FIX lib libdbug so example 2 Fourth switch back to the terminal window of the arbiter and input 1 once You should see output similar to util cc Requests util cc Request 0 ubil ce i r id 1 util cc func pthread_mutex_lock util eed Ee x status ENABLED util cc command RESOURCE_ACCESS util cc Request 1 util cc id 2 util cc func pthread_mutex_lock util cc status ENABLED util cc command RESOURCE_ACCESS The listing tells us that there are currently two pending calls to function pthread mutex lock issued by thread 1 and thread 2 If you input 1 you should see output similar to util cc Requests util cc Request 0 util ccle Lig id 1 util cc func pthread_mutex_unlock util cc status ENABLED util cc command RESOURCE RELEASE util cc Request 1 util cc id 2 util cc func pthread_mutex_lock util cc status DISABLED util cc command RESOURCE_ACCESS The listing tells us that there are currently two pending calls The first call is to function pthread mutex unlock issued by thread 1 and the second call is to function pthread mutex lock issued by thread 2 Also notice that the status of the second call is disabled This is because the arbiter keeps track of shared resources that are being accessed and recognizes when a call such as pth
6. arbiter is notified about the creation of a new process posix spawn posix spawnp Bookkeeping only The arbiter is notified about the creation of a new process setpgid setpgrp setsid Bookkeeping only The arbiter is notified about the change of process group ID wait Controlled by the arbiter Because the wait call is potentially blocking the arbiter collects information from the running processes that allow the arbiter to determine when the call can complete This is achieved by having the interposition layer detect changes in process status by intercepting certain function calls and signals and notifying the arbiter about these events waitpid Controlled by the arbiter On top of the needs of wait the waitpid call requires the arbiter to keep track of the process IDs and process group IDs for every process Again this is achieved by having the interposition layer detect creation of new processes and changes in process group membership and notifying the arbiter about these events Semaphores Only the default values of semaphore attributes are supported sem_init sem_open Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract un named semaphore resource This abstract resource allows arbiter to match wait and post semaphore operations sem_post Controlled by the arbiter Upon servicing a pending call to this routine the arbiter increases the value of the semaph
7. assert pthread_mutex_init mutex1 NULL 0 assert pthread_mutex_init amp mutex2 NULL 0 assert pthread_create amp tid NULL thread NULL assert pthread_mutex_lock amp mutex2 0 assert pthread_mutex_lock amp mutex1 0 printf Critical section master n assert pthread mutex unlock kmutex1 0 assert pthread mutex unlock kmutex2 0 assert pthread_join tid NULL 0 assert pthread_mutex_destroy amp mutex2 0 assert pthread_mutex_destroy amp mutex2 0 return 0 Similarly to the previous example let us compile the code above into its binary form example 3 and run explorer rb prefix DBUG_PREFIX example 3 The explorer explores a total of 6 iterations In order to check whether any iteration encountered an error one can use the following command grep WARNING dbug logs dbug server In our case the command outputs a listing similar to user user VirtualBox dbug grep WARNING dbug logs dbug server logs dbug server 3 WARNING Encountered a concurrency error logs dbug server 4 WARNING Encountered a concurrency error The warning messages imply that during two iterations the arbiter encountered an error In or der to investigate the error one can look at the history file In our example the contents of dbug logs history 3 look as follows 1 1 pthread mutex init 1 1 pthread mutex init 2 2 pthread mutex lock pthread mutex lock 2 2 p
8. c include lt assert h gt include lt pthread h gt include lt stdio h gt int main int argc char argv pthread_mutex_t mutex assert pthread_mutex_init amp mutex NULL 0 assert pthread_mutex_lock amp mutex 0 printf Critical section n assert pthread_mutex_unlock amp mutex 0 assert pthread_mutex_destroy amp mutex 0 return 0 http wiki apache org thrift ThriftInstallation OO MNO O RB UW F First compile the code above into its binary form example 1 Second start up the arbiter by running arbiter m 1 The option m 1 tells the arbiter to run in the interactive mode Third open a new terminal window and start the binary example 1 with the interposition library pre loaded by running LD PRELOAD DBUG PREFIX 1lib libdbug so example 1 Fourth switch back to the terminal window of the arbiter You should see output similar to user user VirtualBox arbiter m 1 server cc Strategy server cc Thread 1 registered server cc Thread 1 updated its process util cc Requests util cc Requests util cc Request 0 util cc id 1 util cc func pthread_mutex_init til ccl Iks status ENABLED util cc command RESOURCE CREATE The listing tells us that there is currently one pending call to function pthread mutex init issued by thread 1 The status and command are not important for the
9. ck of ownership of the lock pthread rwlock rdlock Controlled by the arbiter The pending calls to this routine are postponed until the lock can be shared with the calling thread pthread_rwlock_timedrdlock Controlled by the arbiter The pending calls to this routine are postponed until the lock can be shared with the calling thread or the arbiter decides to let this call time out pthread_rwlock_tryrdlock Controlled by the arbiter The pending calls to this routine either acquire shared access to this lock if possible or return failure otherwise pthread_rwlock_wrlock Controlled by the arbiter The pending calls to this routine are postponed until the lock can be held exclusively by the calling thread pthread rwlock timedwrlock Controlled by the arbiter The pending calls to this routine are postponed until the lock can be held exclusively by the calling thread or the arbiter decides to let his call time out pthread_rwlock_trywrlock Controlled by the arbiter The pending calls to this routine either acquire exclusive access to this lock if possible or return failure otherwise pthread_rwlock_unlock Controlled by the arbiter The pending calls to this routine give up its access rights for the lock pthread_rwlock_destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract read write lock resource POSIX Threads Spin Locks Only the default
10. dBug User Manual Ji im a Computer Science Department Carnegie Mellon University Contents 1 2 Motivation Overview Implementation Installation Examples 5 1 Sequential Example Interactive Mode lt lt lt lt lt lt lt 4 lt 4 4 pe eee 5 2 Concurrent Example Interactive Mode lt lt lt lt lt lt lt lt lt 4 4 4 eee eee 5 3 Concurrent Example Batched Mode lt lt lt lt lt lt lt e 5 4 Concurrent Example Deadlock lt lt lt lt lt 44 5 5 Concurrent Example Data Race lt lt lt lt lt lt lt 4 lt a a Supported Library Calls A 1 POSIX Threads Barriers 22222 A 2 POSIX Threads Conditional Variables lt lt lt lt lt lt lt 444 A 3 POSIX Threads Keys a A 4 POSIX Threads Management A 5 POSIX Threads Mutexes 22 2 5 548 4 bh eR RD ee K BOA R kA A 6 POSIX Threads Read Write Locks lt 4 A 7 POSIX Threads Spin Locks a A 8 Process Management A9 ESEMAphOTES Ae caa po cn a ee al ae eds ete a ake dno k Pady i Bla A 10 Memory Management lt lt lt lt 4 A 11 Non reentrant Functions lt lt lt lt lt lt lt lt 44 4 4 44 ee A2 Miscellaneous a tiri te ac tao Pa a vos z Heat pou hae eee bee 1 Motivation When testing distributed and multi threaded systems their concurrent nature can cause a test to execute in many different ways For the sake of the argument let us assume w
11. e have a concurrent system with a fixed initial state and a test which can execute in N possible ways from the initial state A common technique to address the non deterministic execution of distributed and multi threaded systems is stress testing Stress testing repeatedly executes the same test hoping that eventually all of the possible ways in which the test could have executed and all of the possible errors the test could have detected are encountered In case there is an error in the system and the test has a chance of P to execute in a way that detects the error stress testing is expected to discover the error in P iterations In other words stress testing is good at catching likely errors but might struggle to discover corner case errors that occur with very low probability Because the probability distribution of possible ways in which a test executes can be non uniform and architecture dependent the value of P can be much higher then N In such situations stress testing becomes a very inefficient way of searching for errors The dBug tool offers an alternative to stress testing of concurrent systems which compensates for the aforementioned inefficiency The key idea behind dBug is to control the order in which concurrent events in a distributed and multi threaded system happen The ability to order concur rent events provides dBug with a mechanism to systematically enumerate possible executions of a test one by one By doing so every pos
12. hould execute l Original Distributed System Figure 2 Client Server Architecture Finally in order to systematically explore different executions of a test in a distributed and multi threaded system dBug uses a process called the explorer which repeatedly sets up the initial state of the system starts up the arbiter and provides it with a specific schedule to follow and runs both the system and the test on top of the interposition layer When an execution of the test completes the explorer collects information from the arbiter This information is used by the explorer to gradually build a decision tree of all possible ways in which the arbiter can order concurrent events of the system and the test The decision tree is in turn used to generate arbiter schedules which guide future iterations of the test execution towards unexplored orderings of events 3 Implementation The interposition layer of dBug is implemented as a shared library libdbug so The shared library is to be pre loaded by a dynamic linker during execution of any binary that is to be controlled by dBug The arbiter is implemented as a binary executable arbiter Finally the explorer is implemented as a Ruby script explorer rb 4 Installation In order to use dBug you need to install 1 Boost http www boost org 2 Ruby http www ruby lang org en 3 Ruby Gems http rubygems org 2For details see LD PRELOAD in manpage for 1d so
13. larly to the previous example let us compile the code above into its binary form example 4 and run explorer rb prefix DBUG PREFIX example 4 The explorer explores a total of 2 10 0 0 0 0 2539669330 2454919772 2539669330 2454919772 2454919772 2454919772 2539669330 0 O O 0 2454919772 2 2 iterations In order to check whether any iteration encountered an error one can again use the command grep WARNING dbug logs dbug server In our case the command outputs a listing similar to user user VirtualBox dbug grep WARNING logs dbug server logs dbug server 1 WARNING Concurrent non reentrant function calls logs dbug server 2 WARNING Concurrent non reentrant function calls The warning messages imply that during two iterations the arbiter encountered an error In or der to investigate the error one can look at the history file In our example the contents of dbug logs history 1 look as follows 2 2 2 1 strtok NONREENTRANT_FUNCTION 1 0 00000 0 0 2 strtok NONREENTRANT_FUNCTION 0 1 0 0 0 0 0 0 0 The three lines identify the problem At that point in the execution there are two pending function calls to a function that is not guaranteed by standard or implementation to be reentrant In other words there is a potential data race in the program 11 Appendix A Supported Library Calls The following is a list of library calls that dBug intercepts Some of the
14. ontrolled by the arbiter Upon ser vicing a pending call to this routine the arbiter records this event with the corresponding abstract conditional variable resource pthread cond destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract conditional variable resource POSIX Threads Keys pthread key create Bookkeeping only Upon intercepting a call to this routine the inter position layer creates an abstract key resource This abstract resource allows the interposition layer to determine if a call to pthread getspecific and pthread setspecific accesses an existing key pthread getspecific pthread setspecific Bookkeeping only Upon intercepting a call to this routine the interposition layer checks if the corresponding key exists pthread key delete Bookkeeping only Upon intercepting a call to this routine the interposition layer deletes the corresponding abstract key resource POSIX Threads Management Only the default values of thread attributes are supported A 5 pthread_create Bookkeeping only The arbiter is notified about the creation of a new thread pthread_detach pthread_exit Bookkeeping only The arbiter is notified about the thread status change pthread_join Controlled by the arbiter The pending calls to this routine are postponed until the appropriate thread becomes joinable To this end the arbiter collects informa
15. ore sem_wait Controlled by the arbiter The pending calls to this routine are postponed until the value of the semaphore is positive Upon servicing a pending call to this routine the arbiter decreases the value of the semaphore 15 e sem_close sem_unlink Controlled by the arbiter Upon matching the last close operation with an open operation a pending unlink operation causes the arbiter deletes the correspond ing abstract named semaphore resource e sem_destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract unnamed semaphore resource A 10 Memory Management e calloc free malloc realloc Bookkeeping only The interposition layer keeps track of re allocated pointers This is used to check that each allocated pointer is freed exactly once and no other pointer is attempted to be freed A 11 Non reentrant Functions Certain functions are not reguired to be reentrant by the POSIX standard Conseguently the ar biter controls the order in which they execute and issues a warning if multiple threads of the same process try to concurrently execute the same non reentrant function The list of non reentrant functions controlled by the arbiter includes gethostbyname gethostbyaddr strtok and inet ntoa A 12 Miscellaneous Certain library calls are used by dBug internally In order to avoid introducing false positives dBug needs to intercept calls to
16. read_mutex_lock would block If you try to input 2 the arbiter will warn you that the request of the thread 2 cannot be executed To step through the rest of the execution input the sequence 1 2 2 1 1 Notice how the arbiter detects that the thread 2 cannot be joined by the thread 1 until the thread 2 returns or exits 5 3 Concurrent Example Batched Mode In this example we will reuse the code of the previous example However this time instead of step ping through the program interactively we will use the explorer to automatically explore all possible ways in which the example could have executed In order to do this go to the DBUG DIR tutorial directory and run explorer rb prefix DBUG PREFIX example 2 You should see output similar to user user VirtualBox dbug ruby explorer rb example 2 EXPLORER Iteration 1 Elapsed 0 s EXPLORER Setting up initial state EXPLORER Selecting a strategy EXPLORER Empty strategy EXPLORER Starting the arbiter EXPLORER Waiting for the arbiter to start up EXPLORER Starting the test EXPLORER Waiting for the test to finish Critical section master Critical section slave EXPLORER Waiting for the arbiter to finish EXPLORER Iteration 2 Elapsed 1 s EXPLORER Setting up initial state EXPLORER Selecting a strategy EXPLORER Non empty strategy EXPLORER Starting the arbiter EXPLORER Waiting for the arbiter to start up EXPLORER Starting the test
17. sake of this example and will be explained later The interactive mode expects the user to repeatedly input an integer which identifies the thread that the user wishes to proceed next For instance you can step through the execution of our example by inputting 1 four times 5 2 Concurrent Example Interactive Mode The next example still uses the interactive mode but this time our example is concurrent The pro gram used in this example is listed below and can be found in DBUG DIR tutorial example 2 c include lt assert h gt include lt pthread h gt include lt stdio h gt pthread_mutex_t mutex void thread void args assert pthread_mutex_lock amp mutex 0 printf Critical section slave n assert pthread_mutex_unlock amp mutex 0 return NULL int main int argc char argv pthread_t tid assert pthread_mutex_init amp mutex NULL 0 assert pthread_create amp tid NULL thread NULL 0 assert pthread_mutex_lock amp mutex 0 printf Critical section master n assert pthread_mutex_unlock amp mutex 0 assert pthread_join tid NULL 0 26 27 28 29 assert pthread_mutex_destroy amp mutex 0 return 0 First compile the code above into its binary form example 2 Second start up the arbiter by running arbiter m 1 Third open a new terminal window and start the binary example 2 with the interposition library using LD PRELOAD DBUG PRE
18. se calls are intercepted only for book keeping purposes and the order in which they execute is not controlled by the cen tralized scheduler For each call we include a short description of the activity that happens upon intercepting the call Your system and tests are free to use any other library calls However the use of unsupported communication coordination or blocking primitives can have unexpected consequences In particular e If your system and its tests use unsupported communication and or coordination primitives dBug will not explore all possible orders in which concurrent calls to these unsupported primitives could execute This can result in failing to discover data races that result from ordering events at a finer granularity than that of dBug e If your system and its tests use unsupported blocking primitives the use of dBug could result in false deadlocks For example consider the following scenario There are two threads A and B running in a system Thread A invokes a call intercepted by dBug while thread B invokes an unsupported blocking call In order for the unsupported blocking call to return the execution of thread A needs to resume However this does not happen until the arbiter receives a pending request from every thread of the system Thus there is now a circular dependency as the thread A waits for the arbiter who waits for the thread B who waits for the thread A A 1 POSIX Threads Barriers Only the default val
19. sible execution becomes egually likely and dBug needs in expectation at most 5 iterations of a test to discover an error in case it exists 2 Overview In order to control the order in which concurrent events happen dBug uses an interposition layer that sits between the system and the operating system and shared libraries as illustrated in Figure 1 This interposition layer at run time intercepts calls to select library calls used for coordination and communication between threads of the system Upon interception of a library call the in terposition layer can delay the execution of the call for an arbitrary amount of time Optionally the interposition layer can also decide to inject a fault by simulating an erroneous execution of the library call 5 Figure 1 Interposition Because of the distributed and multi threaded nature of the system being tested dBug uses one instance of the interposition layer per process In order to coordinate the activity of multiple instances of the interposition layer dBug also runs a process called the arbiter which collects For the complete list of intercepted calls see Appendix A information from each instance of the interposition layer The different instances of the interposition layer and the arbiter form a simple client server architecture as illustrated in Figure 2 The arbiter acts as a centralized scheduler of the system and decides in what order the concurrent calls to library routines s
20. the following list of functions getaddrinfo freeaddrinfo For much more thorough testing of the use of dynamic memory we recommend using the Valgrind tool 16
21. thread mutex lock pthread mutex lock 1 02 1 pthread mutex lock 2 pthread mutex lock ND EFFEND NH F F RR RESOURCE CREATE RESOURCE CREATE RESOURCE ACCESS RESOURCE ACCESS RESOURCE ACCESS RESOURCE ACCESS RESOURCE ACCESS RESOURCE ACCESS 4 2 2 0 o 0 0 0 0 The last three lines identify the problem At that point thread 1 acquires the mutex2 creating a circular dependency 5 5 Concurrent Example Data Race In this example we modify the running example to introduce a data race and we illustrate how the explorer aids us in detecting this error The program used in this example is listed below and can be found in DBUG DIR tutorial example 4 c include lt assert h gt include lt pthread h gt include lt stdio h gt include lt string h gt void thread void args 0 0 in the execution no pending function call can execute In other words the execution reached a deadlock Inspecting the order in which events happened tells us that this is the case when the thread 2 acquires the mutex1 and then the char text 4 1 2 printf sXn strtok text printf sXn strtok NULL return NULL int main int argc char argv pthread_t tid char text 4 1 2 assert pthread_create amp tid NULL thread NULL printf s n strtok text printf s n strtok NULL assert pthread_join tid NULL return 0 Simi
22. tion about thread status changes by intercepting the above routines POSIX Threads Mutexes Only the default values of mutex attributes are supported pthread_mutex_init Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract mutex resource This abstract resource allows arbiter to keep track of ownership of the mutex pthread_mutex_lock Controlled by the arbiter The pending calls to this routine are postponed until the mutex becomes available pthread_mutex_timedlock Controlled by the arbiter The pending calls to this routine are postponed until the mutex becomes available or the arbiter decides to let the call time out 13 A 6 pthread_mutex_trylock Controlled by the arbiter The pending calls to this routine acquire the mutex if it is available or return failure otherwise pthread_mutex_unlock Controlled by the arbiter The pending calls to this routine give up the ownership of the mutex pthread_mutex_destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract mutex resource POSIX Threads Read Write Locks Only the default values of read write lock attributes are supported A 7 pthread_rwlock_init Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract read write lock resource This abstract resource allows arbiter to keep tra
23. ues of barrier attributes are supported e pthread_barrier_init Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract barrier resource This abstract resource allows arbiter to determine when a call to pthread_barrier_wait would return e pthread_barrier_wait Controlled by the arbiter The pending calls to this routine are postponed until the threshold specified in pthread_barrier_init is reached e pthread_barrier_destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract barrier resource A 2 POSIX Threads Conditional Variables Only the default values of conditional variable attributes are supported e pthread_cond_init Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract conditional variable resource This abstract resource allows arbiter to determine when a call to pthread_cond_wait and pthread_cond_timedwait would return e pthread_cond_wait Controlled by the arbiter The pending calls to this routine are postponed until a matching signal orbroadcast event has been received 12 A 4 pthread cond timedwait Controlled by the arbiter The pending calls to this routine are postponed until a matching signal orbroadcast event has been received or the arbiter decides to let the call time out pthread cond broadcast pthread cond signal C
24. values of spin lock attributes are supported pthread_spin_init Controlled by the arbiter Upon servicing a pending call to this routine the arbiter creates an abstract spin lock resource This abstract resource allows arbiter to keep track of ownership of the lock pthread_spin_lock Controlled by the arbiter The pending calls to this routine are post poned until the lock becomes available 14 A 9 pthread_spin_trylock Controlled by the arbiter The pending calls to this routine acquire the lock if it is available or return failure otherwise pthread_spin_unlock Controlled by the arbiter The pending calls to this routine give up the ownership of the mutex pthread spin destroy Controlled by the arbiter Upon servicing a pending call to this routine the arbiter deletes the corresponding abstract spin lock resource Process Management execl execlp execle execv execvp execve Bookkeeping only Arbiter is notified that all threads running as part of the calling process terminate and a new thread is started _exit Exit Bookkeeping only Normally when a process is terminated a destructor routine of the interposition layer is called The destructor routine notifies the arbiter that the calling process terminated However a call to this routine bypasses this mechanism Consequently upon intercepting a call to this routine the destructor routine is triggered explicitly fork Bookkeeping only The
Download Pdf Manuals
Related Search
Related Contents
Palm m500 User's Manual Symphonic WF802 Aji Molido Ficha Dataflex ViewKnight Pole Mount 942 洗浄台 HP 8672A User's Manual Copyright © All rights reserved.
Failed to retrieve file