Add Book to My BookshelfPurchase This Book Online

Appendix B - Pthreads Draft 4 vs. the Final Standard

Pthreads Programming
Bradford Nichols, Dick Buttlar and Jacqueline Proulx Farrell
 Copyright 1996 O'Reilly & Associates, Inc.

Mutex Variables
Feature: In the final draft, mutexes have both defined and optional attributes (the priority-scheduling attributes and the process-shared attribute we discussed in Chapter 3, Synchronizing Pthreads). Draft 4 defines no mutex attributes. As a result, the mutex attribute calls listed below and the compile-time constants PTHREAD_PROCESS_SHARED and PTHREAD_PROCESS_PRIVATE have no meaning in a Draft 4 implementation. 
 pthread_mutexattr_getshared 
  pthread_mutexattr_setshared 
 pthread_mutexattr_setprotocol 
  pthread_mutexattr_getprotocol 
  pthread_mutexattr_setprioceiling 
  pthread_mutexattr_getprioceiling 
Feature: Because Draft 4 doesn't allow you to statically initialize mutexes (with PTHREAD_MUTEX_INITIALIZER), you may need to use the pthread_once function in a Draft 4 implementation to avoid library initialization problems. 
Syntax: When dynamically initializing a mutex in a Draft 4 implementation, you use the pthread_mutexattr_default constant to request default attributes. In an implementation that conforms to the final standard, you specify NULL. 

Previous SectionNext Section
Books24x7.com, Inc 2000   Feedback