@c
|
@c
|
@c COPYRIGHT (c) 1988-2002.
|
@c COPYRIGHT (c) 1988-2002.
|
@c On-Line Applications Research Corporation (OAR).
|
@c On-Line Applications Research Corporation (OAR).
|
@c All rights reserved.
|
@c All rights reserved.
|
@c
|
@c
|
@c ch11.t,v 1.11 2002/01/17 21:47:45 joel Exp
|
@c ch11.t,v 1.11 2002/01/17 21:47:45 joel Exp
|
@c
|
@c
|
|
|
@chapter Synchronization
|
@chapter Synchronization
|
|
|
@section Semaphore Characteristics
|
@section Semaphore Characteristics
|
|
|
NOTE: Semaphores are implemented but only unnamed semaphores
|
NOTE: Semaphores are implemented but only unnamed semaphores
|
are currently tested.
|
are currently tested.
|
|
|
@example
|
@example
|
sem_t, Type, Implemented
|
sem_t, Type, Implemented
|
@end example
|
@end example
|
|
|
@section Semaphore Functions
|
@section Semaphore Functions
|
|
|
@subsection Initialize an Unnamed Semaphore
|
@subsection Initialize an Unnamed Semaphore
|
|
|
@example
|
@example
|
sem_init(), Function, Implemented
|
sem_init(), Function, Implemented
|
SEM_FAILED, Constant, Implemented
|
SEM_FAILED, Constant, Implemented
|
@end example
|
@end example
|
|
|
@subsection Destroy an Unnamed Semaphore
|
@subsection Destroy an Unnamed Semaphore
|
|
|
@example
|
@example
|
sem_destroy(), Function, Implemented
|
sem_destroy(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Initialize/Open a Named Semaphore
|
@subsection Initialize/Open a Named Semaphore
|
|
|
@example
|
@example
|
sem_open(), Function, Implemented
|
sem_open(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Close a Named Semaphore
|
@subsection Close a Named Semaphore
|
|
|
@example
|
@example
|
sem_close(), Function, Implemented
|
sem_close(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Remove a Named Semaphore
|
@subsection Remove a Named Semaphore
|
|
|
@example
|
@example
|
sem_unlink(), Function, Implemented
|
sem_unlink(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Lock a Semaphore
|
@subsection Lock a Semaphore
|
|
|
@example
|
@example
|
sem_wait(), Function, Implemented
|
sem_wait(), Function, Implemented
|
sem_trywait(), Function, Implemented
|
sem_trywait(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Unlock a Semaphore
|
@subsection Unlock a Semaphore
|
|
|
@example
|
@example
|
sem_post(), Function, Implemented
|
sem_post(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Get the Value of a Semaphore
|
@subsection Get the Value of a Semaphore
|
|
|
@example
|
@example
|
sem_getvalue(), Function, Implemented
|
sem_getvalue(), Function, Implemented
|
@end example
|
@end example
|
|
|
@section Mutexes
|
@section Mutexes
|
|
|
@subsection Mutex Initialization Attributes
|
@subsection Mutex Initialization Attributes
|
|
|
@example
|
@example
|
pthread_mutexattr_init(), Function, Implemented
|
pthread_mutexattr_init(), Function, Implemented
|
pthread_mutexattr_destroy(), Function, Implemented
|
pthread_mutexattr_destroy(), Function, Implemented
|
pthread_mutexattr_getpshared(), Function, Implemented
|
pthread_mutexattr_getpshared(), Function, Implemented
|
pthread_mutexattr_setpshared(), Function, Implemented
|
pthread_mutexattr_setpshared(), Function, Implemented
|
PTHREAD_PROCESS_SHARED, Constant, Implemented
|
PTHREAD_PROCESS_SHARED, Constant, Implemented
|
PTHREAD_PROCESS_PRIVATE, Constant, Implemented
|
PTHREAD_PROCESS_PRIVATE, Constant, Implemented
|
@end example
|
@end example
|
|
|
@subsection Initializing and Destroying a Mutex
|
@subsection Initializing and Destroying a Mutex
|
|
|
@example
|
@example
|
pthread_mutex_init(), Function, Implemented
|
pthread_mutex_init(), Function, Implemented
|
pthread_mutex_destroy(), Function, Implemented
|
pthread_mutex_destroy(), Function, Implemented
|
PTHREAD_MUTEX_INITIALIZER, Constant, Implemented
|
PTHREAD_MUTEX_INITIALIZER, Constant, Implemented
|
@end example
|
@end example
|
|
|
@subsection Locking and Unlocking a Mutex
|
@subsection Locking and Unlocking a Mutex
|
|
|
@example
|
@example
|
pthread_mutex_lock(), Function, Implemented
|
pthread_mutex_lock(), Function, Implemented
|
pthread_mutex_trylock(), Function, Implemented
|
pthread_mutex_trylock(), Function, Implemented
|
pthread_mutex_unlock(), Function, Implemented
|
pthread_mutex_unlock(), Function, Implemented
|
@end example
|
@end example
|
|
|
@section Condition Variables
|
@section Condition Variables
|
|
|
@subsection Condition Variable Initialization Attributes
|
@subsection Condition Variable Initialization Attributes
|
|
|
@example
|
@example
|
pthread_condattr_init(), Function, Implemented
|
pthread_condattr_init(), Function, Implemented
|
pthread_condattr_destroy(), Function, Implemented
|
pthread_condattr_destroy(), Function, Implemented
|
pthread_condattr_getpshared(), Function, Implemented
|
pthread_condattr_getpshared(), Function, Implemented
|
pthread_condattr_setpshared(), Function, Implemented
|
pthread_condattr_setpshared(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Initialization and Destroying Condition Variables
|
@subsection Initialization and Destroying Condition Variables
|
|
|
@example
|
@example
|
pthread_cond_init(), Function, Implemented
|
pthread_cond_init(), Function, Implemented
|
pthread_cond_destroy(), Function, Implemented
|
pthread_cond_destroy(), Function, Implemented
|
PTHREAD_COND_INITIALIZER, Constant, Implemented
|
PTHREAD_COND_INITIALIZER, Constant, Implemented
|
@end example
|
@end example
|
|
|
@subsection Broadcasting and Signaling a Condition
|
@subsection Broadcasting and Signaling a Condition
|
|
|
@example
|
@example
|
pthread_cond_signal(), Function, Implemented
|
pthread_cond_signal(), Function, Implemented
|
pthread_cond_broadcast(), Function, Implemented
|
pthread_cond_broadcast(), Function, Implemented
|
@end example
|
@end example
|
|
|
@subsection Waiting on a Condition
|
@subsection Waiting on a Condition
|
|
|
@example
|
@example
|
pthread_cond_wait(), Function, Implemented
|
pthread_cond_wait(), Function, Implemented
|
pthread_cond_timedwait(), Function, Implemented
|
pthread_cond_timedwait(), Function, Implemented
|
@end example
|
@end example
|
|
|
|
|