Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>POSIX specifies the memory model in <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_11">4.11 Memory Synchronization</a>:</p> <blockquote> <p>Applications shall ensure that access to any memory location by more than one thread of control (threads or processes) is restricted such that no thread of control can read or modify a memory location while another thread of control may be modifying it. Such access is restricted using functions that synchronize thread execution and also synchronize memory with respect to other threads. The following functions synchronize memory with respect to other threads:</p> <ul> <li>fork()</li> <li>pthread_barrier_wait()</li> <li>pthread_cond_broadcast()</li> <li>pthread_cond_signal()</li> <li>pthread_cond_timedwait()</li> <li>pthread_cond_wait()</li> <li>pthread_create()</li> <li>pthread_join()</li> <li>pthread_mutex_lock()</li> <li>pthread_mutex_timedlock()</li> <li>pthread_mutex_trylock()</li> <li>pthread_mutex_unlock()</li> <li>pthread_spin_lock()</li> <li>pthread_spin_trylock()</li> <li>pthread_spin_unlock()</li> <li>pthread_rwlock_rdlock()</li> <li>pthread_rwlock_timedrdlock()</li> <li>pthread_rwlock_timedwrlock()</li> <li>pthread_rwlock_tryrdlock()</li> <li>pthread_rwlock_trywrlock()</li> <li>pthread_rwlock_unlock()</li> <li>pthread_rwlock_wrlock()</li> <li>sem_post()</li> <li>sem_timedwait()</li> <li>sem_trywait()</li> <li>sem_wait()</li> <li>semctl()</li> <li>semop()</li> <li>wait()</li> <li>waitpid()</li> </ul> <p>The pthread_once() function shall synchronize memory for the first call in each thread for a given pthread_once_t object.</p> <p>The pthread_mutex_lock() function need not synchronize memory if the mutex type if PTHREAD_MUTEX_RECURSIVE and the calling thread already owns the mutex. The pthread_mutex_unlock() function need not synchronize memory if the mutex type is PTHREAD_MUTEX_RECURSIVE and the mutex has a lock count greater than one.</p> <p>Unless explicitly stated otherwise, if one of the above functions returns an error, it is unspecified whether the invocation causes memory to be synchronized.</p> <p>Applications may allow more than one thread of control to read a memory location simultaneously.</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload