Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-09-25 11:53:20

> POSIX says "On return from pthread_once( ), it is guaranteed that
> init_routine has completed." Does "completion" imply that the results are
> visible to all threads?

well, it is the only way i can interpret that statement.
however, it would be really nice to have pthread_once
listed under:

"3111 4.10 Memory Synchronization
 3112 Applications shall ensure that access to any memory location by more
than one thread of control
 3113 (threads or processes) is restricted such that no thread of control
can read or modify a memory
 3114 location while another thread of control may be modifying it. Such
access is restricted using
 3115 functions that synchronize thread execution and also synchronize
memory with respect to other
 3116 threads. The following functions synchronize memory with respect to
other threads:
 3117 fork ()
 3118 pthread_barrier_wait()
 3119 pthread_cond_broadcast()
 3120 pthread_cond_signal ()
 3121 pthread_cond_timedwait()
 3122 pthread_cond_wait()
 3123 pthread_create()
 3124 pthread_join ()
 3125 pthread_mutex_lock()

(similar to pthread_join)


ps. note that there is even bigger problem with respect to currently
term "memory location" and lack of portable ways to "adopt" programs to
platform specific memory (and/or cache) granularity - which could result in
word tearing (correctness) and cache trashing/false sharing (performance)
problems :(

Boost list run by bdawes at, gregod at, cpdaniel at, john at