Self-test questions
For multiple choice questions, choose all options that apply:
- What happens if you do not call
join
ordetach
on aboost::thread
object and astd::thread
object?a.
join
is called on underlying thread ofboost::thread
.b.
std::terminate
is called forstd::thread
, terminating the program.c.
detach
is called on underlying thread ofboost::thread
.d.
detach
is called on underlying thread ofstd::thread
. - What happens if an exception is allowed to propagate past the initial function with which a
boost::thread
object is created?a. The program is terminated via
std::terminate
.b. It is undefined behavior.
c. The call to
get
on thefuture
object throws an exception in the calling thread.d. The thread is terminated but the exception is not ...
Get Learning Boost C++ Libraries now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.