Understanding Weak Ordering and Thread Management in Pthreads
This lecture reviews essential concepts in relaxed memory consistency models, which include weak ordering, relaxed program order, and relaxed write atomicity. It delves into Pthreads, explaining how to compile Pthread programs, create new threads, and manage their lifecycles. Key questions addressed include the termination of threads, the behavior of parent and child threads, and the implications of calling exit() within a thread. This knowledge is crucial for developing concurrent applications that function reliably under various memory consistency conditions.
Understanding Weak Ordering and Thread Management in Pthreads
E N D
Presentation Transcript
Lecture 7 review • Weak ordering memory consistence • Relaxed memory consistence • Relaxed program order • Relaxed write atomicity • Pthread • How to compile a pthread program? • How to create a new thread? • When is a thread terminated? • Does parent thread get to run before the child thread? • What happens when we call exit() in a thread?