Click to See Complete Forum and Search --> : Choosing among the Linux options


michielverschueren
April 19th, 2010, 09:30 AM
Hi,

I'm looking for a comparison of the different existing solutions to multithreading on Linux with C++.
I know that several libraries exist, but I have no idea of the main advantages and drawbacks of each one. Can anyone point me in the right direction?

Cheers

Lindley
April 20th, 2010, 11:39 AM
Some of the more common ones....

pthreads - Widely used, but C-based, so it isn't the most elegant for use with C++. Pretty simple though if you don't mind a few void*s.

Boost Threads - A C++ based library so it's fully type-safe. Introduces a dependency on Boost though, which not everyone will like.

gthreads - Part of glib. Basically a thin wrapper around pthreads, but some might find the interface more intuitive.

C++1x standard threads - I don't think these are supported yet, but they soon will be, so they're something you need to consider.

michielverschueren
April 21st, 2010, 02:57 AM
Thanks, I'll have a look at those