mutexes are used to serialize access to *shared data*. Don't use them for non-shared data, and don't use them if your program's logic ensures that only one thread is accessing a particular data structure at a single time.
Explore more quotes
pthread_cond_wait() simultaneously unlock the mutex (so that other threads can modify the linked list) and wait on the condition (so that pthread_cond_wait() will wake up when it is "signalled" by another thread). Now that the mutex is unlocked, other threads can access and modify the linked list, possibly adding items
Immediately after unlocking the mutex, thread 2 calls the function pthread_cond_broadcast(&mycond). By doing so, thread 2 will cause all threads waiting on the mycond condition variable to immediately wake up. This means that our first thread (which is in the middle of a pthread_cond_wait() call) will now wake up.
After thread 2 called pthread_cond_broadcast(&mymutex) you might think that thread 1's pthread_cond_wait() will immediately return. Not so! Instead, pthread_cond_wait() will perform one last operation: relock mymutex. Once pthread_cond_wait() has the lock, it will then return and allow thread 1 to continue execution.
There's almost 70 billion in square feet under construction in high rises in commercial, residential and light manufacturing. And we estimate about 30 billion square feet, and that's with a 'B,' is commercial, that we would just consider office space. To put that in perspective, that's a 5x5-foot cubicle for every man, woman and child in China.
It's so easy to get whisked away in the hubbub of friends, work and busy-ness, but we need to take the time to be still and become aware of ourselves. The small things. The fact that we're still breathing. Our ability to move. The presence of love around and in us. Our strengths. Our opportunities. Our journeys.