Main interface reference is Bjarne Stroustrup’s C++ Programming Language 3rd edition and the C++ standard. This section will be based on the style in the book.
Main implementation reference will be llvm libc++ implementation
- std::thread: it needs to join or detach. use RAII to make sure it will be handled correctly.
- std::mutex: RAII with std::lock_guard or std::unique_lock(can lock multiple mutex and unlock)
- std::recursive_mutex: allow a thread to acquire a mutex multiple times without deadlock
- not thread-safe
- sort: looks optimized using different sort (insertion <-> quick) when length is short or long
- lambda expression
- concept, constraint