Meeting 23: Detailed Example: A thread-safe queue in C++11

Today we are going to look in detail at how to make a data structure thread-safe.

Links:

Exercise 23: Thread-Safe Vector

GitHub Invitation URL: exercise23

Steps:

  1. Clone the assignment for today after accepting the GitHub invitation at the link above. The repository contains three files:
  1. Implement a generic vector that is thread-safe in vector.hpp using C++11 synchronization primitives similar the the thread-safe queue.

  2. Write some tests for your vector in test_vector.cpp using C++11 threads.

  3. Verify your code compiles and your tests work.

  4. Now, use git to commit the source files changed to the local repository.

  5. Finally, use git push to synchronize the repository with that on GitHub.

You have completed the Exercise.