C++20 Concurrency: std::jthread
This new threading mechanism will greatly improve your existing code
C++20 has introduced several new features to help developers write simpler, safer, and more efficient concurrent code. One of these features is the std::jthread
mechanism.
What is it?
std::jthread
is a new concurrency mechanism in C++20 that represents a joinable thread (hence the “j” in “jthread”) with automatic cleanup. std::jthread
also incorporates some of the other new C++20 concurrency features, such as…