std::jthread stands for joining thread. In addition to std::thread (C++11), std::jthread automatically joins in its destructor and can cooperatively be interrupted. Read in this post to know why std::jthread should be your first choice.
A typical question in my C++ seminars is: Can A thread be killed?. Before C++20, my answer is no. With C++20, you can ask a thread politely for its interruption.
One of the participants in my CppCon 2018 workshop asked me: "Can a std::thread be interrupted?". No, was my answer but this is not correct anymore. With C++20 we might get a std::jthread.
Hunting
Today 4203
Yesterday 7411
Week 27431
Month 171602
All 11652756
Currently are 221 guests and no members online
Kubik-Rubik Joomla! Extensions
Read more...
Read more...