thread destructors in C++0x vs boost
Posted
by
Abruzzo Forte e Gentile
on Stack Overflow
See other posts from Stack Overflow
or by Abruzzo Forte e Gentile
Published on 2010-12-22T10:22:52Z
Indexed on
2010/12/22
11:54 UTC
Read the original article
Hit count: 175
Hi All
These days I am reading the pdf Designing MT programs . It explains that the user MUST explicitly call detach()
on an object of class std::thread
in C++0x
before that object gets out of scope. If you don't call it std::terminate()
will be called and the application will die.
I usually use boost::thread
for threading in C++. Correct me if I am wrong but a boost::thread
object detaches automatically when it get out of scope.
Is seems to me that the boost approach follow a RAII principle and the std doesn't.
Do you know if there is some particular reason for this?
Kind Regards
AFG
© Stack Overflow or respective owner