12 - Thread Synchronization

Class: CSCE-313


Notes:

Atomic Operations

...

Notes:

Synchronization Variable - Lock to Provide Mutual Exclusion

...

Notes:

What is a mutex?

...

Notes:

What is a critical section?

...

Notes:

Mutex thread synchronization

...

Notes:

Mutex thread synchronization

...

Mutex in C++ for Thread Safety

...

...

Notes:

Now when we do:

./a.out 1000000
data = 2000000
...

Mutex in C++ -- Finer Locking

...

Notes:

When we do:

./a.out 1000000
data = 2000000

Timeline of Coarse/Fine Grained Locking

Notes:

Producer-Consumer Synchronization

...

Notes:

Producer-Consumer: problems

Notes:

Solution:
...

Notes: