Книга: Programming with POSIX® Threads

10.1 X/OpenXSH5(UNIX98)

Mutex type attribute:

int pthread_mutexattr_gettype (

const pthread_mutexattr_t *attr, int *type); int pthread_mutexattr_settype (

pthread_mutexattr_t *attr, int type);

Read/write locks:

int pthread_rwlock_init (pthread_rwlock_t *rwlock,

const pthread_rwlockattr_t *attr); int pthread_rwlock_destroy (pthread_rwlock_t *rwlock); pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER; int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock); int pthread_rwlock_tryrdlock (

pthread_rwlock_t *rwlock); int pthread_rwlock_unlock (pthread_rwlock_t *rwlock); int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock); int pthread_rwlock_trywrlock (

pthread_rwlock_t *rwlock); int pthread_rwlockattr_init (

pthread_rwlockattr_t *attr); int pthread_rwlockattr_destroy (

pthread_rwlockattr_t *attr); int pthread_rwlockattr_getpshared (

const pthread_rwlockattr_t *attr, int *pshared); int pthread_rwlockattr_setpshared (

pthread_rwlockattr_t *attr, int pshared);

Parallel I/O:

size_t pread (int fildes,

void *buf, size_t nbyte, off_t offset); size_t pwrite (int fildes,

const void *buf, size_t nbyte, off_t offset);

Miscellaneous:

int pthread_attr_getguardsize (

const pthread_attr_t *attr, size_t *guardsize); int pthread_attr_setguardsize (

pthread_attr_t *attr, size_t guardsize); int pthread_getconcurrency (); int pthread_setconcurrency (int new_level);

X/Open, which is part of The Open Group, owns the UNIX trademark and develops UNIX industry portability specifications and brands. The X/Open brands include XPG3, XPG4, UNLX93, and UNLX95. UNLX95 is also known as "SPEC1170" or the "Single UNIX Specification."

X/Open recently published the X/Open CAE Specification, System Interfaces and Headers, Issue 5 (also known as XSH5), which is part of the new UNLX98 brand. XSH5 requires conformance to the POSIX.1-1996 standard, which includes the POSIX.1b and POSIX.1c amendments. The XSH5 specification also adds a set of extensions to POSIX. This section discusses the XSH5 extensions that specifically affect threaded programs. You can recognize a system conforming to XSH5 by a definition for the _XOPEN_VERSION symbol, in <unistd.h>, to the value 500 or higher.

The most valuable contribution of UNLX98 to the threaded programming industry, however, is possibly the development of a standardized, portable testing system. A number of complicated issues arise when developing an implementation of Pthreads, and some subtle aspects of the standard are ambiguous. Such an industry-wide testing system will require all vendors implementing UNLX98 branded systems to agree on interpretations of Pthreads.

Оглавление книги


Генерация: 0.054. Запросов К БД/Cache: 0 / 1
поделиться
Вверх Вниз