The Linux Programming Interface
Threads: Thread Safety and Per-Thread Storage 657 Reentrant and nonreentrant functions Although the use of critical sections to ...
658 Chapter 31 For several of the functions that have nonreentrant interfaces, SUSv3 specifies reentrant equivalents with names ...
Threads: Thread Safety and Per-Thread Storage 659 The once_control argument is a pointer to a variable that must be statically i ...
660 Chapter 31 31.3.1 Thread-Specific Data from the Library Function’s Perspective In order to understand the use of the thread- ...
Threads: Thread Safety and Per-Thread Storage 661 “save this pointer, recording the fact that it is associated with a particular ...
662 Chapter 31 z a set of per-thread arrays, each containing pointers to all of the thread-specific data blocks allocated for a ...
Threads: Thread Safety and Per-Thread Storage 663 named myfunc(). For each thread, the Pthreads API maintains an array of pointe ...
664 Chapter 31 On many UNIX implementations, including Linux, the strerror() function provided by the standard C library is thre ...
Threads: Thread Safety and Per-Thread Storage 665 Both threads displayed the errno string corresponding to EPERM, because the ca ...
666 Chapter 31 key that is stored in the global variable strerrorKey e. The call to pthread_key_create() also records the addres ...
Threads: Thread Safety and Per-Thread Storage 667 char * strerror(int err) { int s; char *buf; /* Make first caller allocate key ...
668 Chapter 31 31.3.5 Thread-Specific Data Implementation Limits As implied by our description of how thread-specific data is ty ...
Threads: Thread Safety and Per-Thread Storage 669 Listing 31-4: A thread-safe implementation of strerror() using thread-local st ...
670 Chapter 31 to change its interface. Both of these techniques allow a function to allocate persis- tent, per-thread storage. ...
Chapter 32: Threads: Thread Cancellation Typically, multiple threads execute in parallel, with each thread performing its task u ...
672 Chapter 32 Having made the cancellation request, pthread_cancel() returns immediately; that is, it doesn’t wait for the targ ...
Threads: Thread Cancellation 673 The thread’s previous cancelability type is returned in the location pointed to by oldtype. As ...
674 Chapter 32 various functions that retrieve information from system files such as the utmp file. A portable program must corr ...
Threads: Thread Cancellation 675 printf("New thread started\n"); /* May be a cancellation point */ for (j = 1; ; j++) { printf(" ...
676 Chapter 32 A thread that is executing code that does not otherwise include cancellation points can periodically call pthread ...
«
31
32
33
34
35
36
37
38
39
40
»
Free download pdf