Which is better for windows? pthreads or CreateMutex? Which is better for windows? pthreads or CreateMutex? windows windows

Which is better for windows? pthreads or CreateMutex?


It's all going to be the same stuff (pthreads is just going to call EnterCriticalSection etc), so if you've got a pthreads wrapper, you should probably use it so that you don't have to change as much code


this works well: http://sourceware.org/pthreads-win32/

It is a port of the pthreads library for Windows.


One thing you need to keep in mind is what is the future of this code. Do you plan on developing (and releasing) on both platforms in the future? Or is this a one way port?

The best thing to do when porting a project is to keep the actual changes to the code as minimal as possible. In your case, this would mean going with a pthread solution. That being said, if you are planning this to be a one way port, going native never hurts. :)

I would take some time to fully examine both stratigies and then implement the one you feel most comfortable with.