PDA

View Full Version : c++ and Pthreads



Rij
October 15th, 2007, 06:08 AM
Is using pthreads with C++ a bad idea?

KaeseEs
October 15th, 2007, 10:21 AM
There's nothing wrong with using PThreads with C++. In fact, it is probably the best threading implementation available for C++, being efficient, relatively easy to use, full-featured, and cross-platform.

Rij
October 15th, 2007, 02:57 PM
Thanks.

dwhitney67
October 15th, 2007, 10:39 PM
I second KaeseEs opinion, however before you go polluting your code with pthread implementations, consider using the Boost libraries (http://www.boost.org/) for your needs.

If you still insist on writing your own pthread implementations, then I suggest that you write wrapper-classes around the necessary pthread components you need so that the draconian interface is "hidden" from the application code.