Book Image

Learning Boost C++ Libraries

By : Arindam Mukherjee
Book Image

Learning Boost C++ Libraries

By: Arindam Mukherjee

Overview of this book

Table of Contents (19 chapters)
Learning Boost C++ Libraries
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Self-test questions


For multiple choice questions, choose all options that apply:

  1. What happens if you do not call join or detach on a boost::thread object and a std::thread object?

    a. join is called on underlying thread of boost::thread.

    b. std::terminate is called for std::thread, terminating the program.

    c. detach is called on underlying thread of boost::thread.

    d. detach is called on underlying thread of std::thread.

  2. 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 the future object throws an exception in the calling thread.

    d. The thread is terminated but the exception is not propagated.

  3. Should you call notify_one or notify_all on a condition_variable object without holding the associated mutex?

    a. No, the call will block.

    b. Yes, but it may result in priority inversion in some cases.

    c. No, some waiting threads may miss the...