C Threading Library

closed account (S6k9GNh0)
Anyone know of any C cross-platform thread libraries?
pthreads
closed account (S6k9GNh0)
I was thinking pthreads is to Linux only. Little did I know after I did the research, pthreads is another specification adopted by many platforms except of course Microsoft Windows. Fortunately, someone took the time to implement the pthread API natively on Windows.

http://sourceware.org/pthreads-win32/

It looks a bit out of date but it should be okay... I hope....
Last edited on
for windows you can use windows threads also.
closed account (S6k9GNh0)
yeah, but when I have an application that is already implemented with the pthreads API, that's a lot of trouble.

Also trying Cygwin right now. Seems libgsm keeps giving me crap.

Anyone know anything truly bad about about using Cygwin?
Last edited on
For one reason or another, I can never compile anything sufficiently complex with Cygwin. MSYS is even worse.
closed account (S6k9GNh0)
Yeah, Cygwin is quite convenient but it does do some rather dumb things.

A great example is taking out a re-entrant function (gethostbyname_r) because gethostbyname is thread safe in there library. But now every person who implemented using gethostbyname_r has to setup a crappy macro to fix all of this.

MSys is by no means the same as Cygwin though. Cygwin attempts to implement a POSIX compliant API, thus allowing most Linux applications to compile on Win32 under certain circumstances. This is a great benefit though, even with the small kinks. If this didn't exist, I couldn't use BSD sockets or pthreads, especially since no one else implemented this in an individual library or API.

MinGW doesn't do this and simply gives a minimal GCC environment. It also provides it's own version of win32 gcc.
Last edited on
ACE provides a WIN32 pthreads implementation.
If you mean C++ then the boost library has cross platform thread support.

http://www.boost.org/

The thread library is described here:

http://www.boost.org/doc/libs/1_40_0/doc/html/thread.html
Last edited on
Topic archived. No new replies allowed.