Sign in to follow this  

C++ and cross platform threads

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anybody know of an easy to use cross platform multi-threading library that is easy to use like the Thread class for Java? thanks, JDev

Share this post


Link to post
Share on other sites
boost::thread ? (i dont even know if it exists, but i have a vague memory of hearing about one, and its a pretty good bet one exists, i dont know about cross platform-ness though)

also, there are some c standard thread functions also, but its an ugly setup, i dunno if thats what you would want

hope that helps
-Dan

Share this post


Link to post
Share on other sites
I use trolltech Qt for multithreading over many platforms, but not everyone has access to that (dang commercial libraries) and you've pretty well got to build around thier framework for it anyways. I've been pointed to the wxWidget classes in the past, but haven't used them myself ( http://www.wxwidgets.org/ ) Probably another framework you'd have to write code around, other than that, go with the Boost stuff, I've heard a lot of good things about Boost in general, if you don't mind picking through it for what you want.

Share this post


Link to post
Share on other sites
You could try pthreads, although it's a C lib, so no classes. I know there are implementations for several unix platforms and linux. I think there is a windows implementation as well.

HTH

Share this post


Link to post
Share on other sites
Be aware that although creating cross-platform threads is relatively straightforward, the thread-safety of other libraries is not guaranteed to be consistent between platforms, so read the docs carefully so you can do the right locking / avoid doing things in multiple threads.

For example you could easily find that a particular library function is thread-safe on some platforms but not others.

Mark

Share this post


Link to post
Share on other sites

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this