Are there any multiplatform libraries for threads to be used with C++? If not I don't mind windows specific ones, but in general what are good multithreading solutions for C++/C?
Are there any multiplatform libraries for threads to be used with C++? If not I don't mind windows specific ones, but in general what are good multithreading solutions for C++/C?
pthreads might be something that you want. There should be a "pthreads for Windows" library floating around.
cool, thanks. Nice avatar btw. I'm learning Threads with Java but since I do my personal and hobby Programs in C++ I'm more interested in this for the long run.
Boost::threads is probably the best around though: you don't have every facility of pthreads, but it works on more platforms/compilers than anything else (I think).
*has flashbacks of trying to build boost*
MAKE IT STOOOOP.
It was more hastle than it should have been.
Do you need to build boost to use the threads library? Most of the boost libraries don't require a build, although I guess the threads one would be more likely than others to require it.
There was a post made a while ago, either here or on the Tech board, that had a nice explanation of how to build Boost. If you haven't already seen it, it might help.
I don't know, I hate dealing with building libraries, they are just so annoying.
I had a lot of trouble building boost too . . . on the first computer I compiled it on, I ran out of disk space (not a good sign). The next computer I tried compiling it on had an incompatible environment of some sort (I don't remember what was wrong with it), so I got to compile each source file by hand. It wasn't fun . . . and after all of that I never use it.I don't know, I hate dealing with building libraries, they are just so annoying.
pthreads work quite well, even on Windows (for which you usually use winsock2). I recommend them.
Last edited by dwks; 03-30-2007 at 03:10 PM.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Anyone heard of ztheads.
Boost.Threads requires building.
Strangely enough, I never had any problems building Boost. I downloaded it, unpacked it, ran the commands and it worked.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
can you build only certain parts of boost rather than the entire thing.
Yes, but that's more complicated.
(All right, so it mostly means being in a different directory when typing the bjam command. That's one way, at least.)
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
*hears bjam*
*snap*
Sadly, I downloaded it, unpacked it, ran the commands and it JammedI downloaded it, unpacked it, ran the commands and it worked.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)