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.

Condition Variables
Feature: In the final draft, condition variables have both defined and optional attributes (the process-shared attribute we discussed in Chapter 4, Managing Pthreads). Draft 4 defines no condition variable attributes. As a result, the condition variable attribute calls (which are pthread_condattr_getshared and pthread_condattr_setshared) and the compile-time constants (which are PTHREAD_PROCESS_SHARED and PTHREAD_PROCESS_PRIVATE) have no meaning in a Draft 4 implementation. 
Feature: Because Draft 4 doesn't allow you to statically initialize condition variables (using the PTHREAD_COND_INITIALIZER constant), you may need to use the pthread_once function in a Draft 4 implementation to avoid library initialization problems. 
Syntax: When dynamically initializing a condition variable in a Draft 4 implementation, you use the pthread_condattr_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