Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What must be done with a std::thread before its destructor runs?

  1. A It must be joined or detached
  2. B It must be reset
  3. C Nothing is required
  4. D It must be locked
Answer

It must be joined or detached

A joinable thread being destroyed calls std::terminate. std::jthread in C++20 joins automatically in its destructor.

All C++ MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as