Just pick up the TDM-GCC 64x package. (It constains both the 32 and 64 bit versions of the MinGW toolchain and comes within a neat installer.) More importantly, it contains something called the "winpthread" library.
It comprises of the pthread.h
header, libwinpthread.a
, libwinpthread.dll.a
static libraries for both 32-bit and 64-bit and the required .dlls libwinpthread-1.dll
and libwinpthread_64-1.dll
(this, as of 01-06-2016).
You'll need to link to the libwinpthread.a
library during build. Other than that, your code can be the same as for native Pthread code on Linux. I've so far successfully used it to compile a few basic Pthread programs in 64-bit on windows.
Alternatively, you can use the following library which wraps the windows threading API into the pthreads API: pthreads-win32.
The above two seem to be the most well known ways for this.
Hope this helps.