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()
 pthread_mutex_timedlock()
 pthread_mutex_trylock()
 pthread_mutex_unlock()
 pthread_spin_lock()
 pthread_spin_trylock()
 pthread_spin_unlock()
 pthread_rwlock_rdlock()
 pthread_rwlock_timedrdlock()
 pthread_rwlock_timedwrlock()
 pthread_rwlock_tryrdlock()
 pthread_rwlock_trywrlock()
 pthread_rwlock_unlock()
 pthread_rwlock_wrlock()
 sem_post()
 sem_trywait()
 sem_wait()
 wait()
 waitpid()"

(similar to pthread_join)

regards,
alexander.

ps. note that there is even bigger problem with respect to currently
undefined
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 :(

http://groups.google.com/groups?as_umsgid=3B4F347E.C4B10D24%40web.de
http://groups.google.com/groups?as_umsgid=3B55DC62.2CCE3B26%40web.de
http://groups.google.com/groups?as_umsgid=3507F7A3.FA651B43%40zko.dec.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk