Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost.Thread or just::thread?

I am not yet a Boost user. I am however planning to go into it as soon as possible. However I am little concerned about Boost, and the likely future name collisions or differences with the forthcoming C++0x. (Maybe it is not a real issue, but for example I find the boost lambdas syntax pretty ugly, BOOST_FOREACH aggressive to the eye, and other only aesthetic personal views).

I am really interested by the TR2, which seems to be implemented by the libraries Boost.Thread and just::thread. Both seems to be written and maintained by Anthony Williams.

But just::thread claims to be closely compliant with the TR2.

I wanted to know if any one of you would indicate me to use one or the other. just::thread is not free, but if it was to be really just like TR2, I am tempted.

Any thought ?

like image 367
Stephane Rolland Avatar asked Aug 24 '10 09:08

Stephane Rolland


1 Answers

At the present time I am experimenting, on Linux, with the boost, just::thread libraries and the so-called 'experimental' C++Ox features of the gcc g++ 4.5 compiler. With regard to threading I have up to press I have found the code that I have written for just::thread and the g++ compiler to be 100% compatible. The boost libraries (1.43) are markedly not compatible with the former two. However, for my production code I use the boost libraries.

Name collision should not be a problem with the correct and judicious use of the available namespaces in boost, just::thread and the g++ compilers. I have no problem using just::thread with the C++Ox g++ features; indeed it is recommended by just::thread that these features are used, such as variadic templates.

like image 177
Sam Avatar answered Sep 28 '22 16:09

Sam