Posix Threads & Windows

Kevin D. Clark kevin_d_clark at comcast.net
Wed Dec 21 16:30:08 EST 2005


Anthony Gabrielson <agabriel at home.tzo.org> writes:

> 	Quick question, I need to write a thread/sema app that uses POSIX  
> calls under windows.  I want to use the posix calls since within the next 
> few months this will be running under Linux ( I need to sort the Linux 
> drivers and data acq API out before I can even think about this app with 
> Linux).  So I would like to use SFU with Vis C and I just wanted to see if 
> anyone had any experience getting that going that could share with me.

I have some experience in this area.  A few years ago I used this
library:

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

to do pthreads sorts-of-things within the win32 API (this was native
code, not using the not-very-useful win32 POSIX layer).  I too was
using Visual C (C++ actually...).

A couple of potential gotchas that I ran into at the time:

1:  pthread_kill() wasn't able to signal other threads, even in the
same process.  The win32 thread model doesn't support this.

2:  it wasn't entirely clear to me when I audited the code where all
of the pthread_cancel()-able codepoints were.  Caveat programmer...

3:  I had some difficulty with pthread_cancel()-related cleanup
functions. 

3:  In C++ code, exception handling was a bit flaky.  Sometimes some
of my destructors weren't called.


Other than these problems (which I was able to code around), I found
this library to be of very high quality.

Regards,

--kevin
-- 
GnuPG ID: B280F24E

C/C++/Perl/Networking engineer looking for work (in NH)
Contact for details.





More information about the Discuss mailing list