If you need pthreads for Windows MinGW projects, most projects used pthreads-win32 from Red Hat. However, it wasn't completely compatible with POSIX versions of pthreads. It also uses LGPL licensing which can be somewhat restrictive with MIT and BSD style licensed projects. So, the MinGW64 project wrote their own pthreads implementation from scratch which is available at the MinGW64 web site. Looking at the code, I wasn't sure if the MinGW64 pthreads implementation would work with the MinGW (www.mingw.org) 32 bit compiler as is or if it would need patching. So, I decided to use another alternative for my own projects. Another option on Windows is the midipix project which uses the musl C library pthread implementation.
Many libraries including musl add C11 and C++11 thread support using their POSIX thread implementations. That's because pthreads were available long before the C11 standards were created.
I wanted a simple, cross-platform portable implementation of pthreads. I also wanted to learn more about threads especially C11 threading standards. So, I wrote my own C11 threads library and a pthreads implementation based on it. C11 threads seem more concise, so I wanted to implement C11 support independent of pthreads and then tried implementing pthreads using C11 threads. My library mainly uses semaphores (which are available on most systems). I've read that systems like Haiku exclusively use semaphores for synchronization. While the library is written for portability, I haven't finished adding code or testing for certain platforms. I have used my threading libraries when building MinGW (my own 32 bit version of the compiler) with C++11 threading support enabled.
Before I wrote my library, I used c11threads and TinyCThread with various projects I was porting to fill the gap in support for C11 and C++11 threads. Both are useful if you don't have other alternatives. Now, that I've built MinGW with my own thread libraries, I haven't had any major issues with C11, C++11 and POSIX thread support.
Here are some links I like related to thread libraries and implementations.
Interesting article on semaphores also some source code examples:
http://preshing.com/20150316/semaphores-are-surprisingly-versatile/
Article on benaphores with sample code:
http://preshing.com/20120226/roll-your-own-lightweight-mutex/
Recursive mutex using benaphores with sample code:
http://preshing.com/20120305/implementing-a-recursive-mutex/
Haiku - articles on Condition Variables
https://www.haiku-os.org/legacy-docs/benewsletter/Issue4-39.html
https://www.haiku-os.org/legacy-docs/benewsletter/Issue4-40.html
pthreads-win32
http://sourceware.org/pthreads-win32/
Bionic C library pthreads implementation
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/
Haiku pthread implementation
https://github.com/luciang/haiku/tree/master/src/system/libroot/posix/pthread
TinyCThread
C11 threads implementation
https://tinycthread.github.io/
c11threads
GNU compatibility headers for C11 thread support
https://github.com/jtsiomb/c11threads
Upthreads
A user space implementation of the POSIX thread library implemented using setjmp/longjump (or equivalent).
http://upthread.sourceforge.net/
Many libraries including musl add C11 and C++11 thread support using their POSIX thread implementations. That's because pthreads were available long before the C11 standards were created.
I wanted a simple, cross-platform portable implementation of pthreads. I also wanted to learn more about threads especially C11 threading standards. So, I wrote my own C11 threads library and a pthreads implementation based on it. C11 threads seem more concise, so I wanted to implement C11 support independent of pthreads and then tried implementing pthreads using C11 threads. My library mainly uses semaphores (which are available on most systems). I've read that systems like Haiku exclusively use semaphores for synchronization. While the library is written for portability, I haven't finished adding code or testing for certain platforms. I have used my threading libraries when building MinGW (my own 32 bit version of the compiler) with C++11 threading support enabled.
Before I wrote my library, I used c11threads and TinyCThread with various projects I was porting to fill the gap in support for C11 and C++11 threads. Both are useful if you don't have other alternatives. Now, that I've built MinGW with my own thread libraries, I haven't had any major issues with C11, C++11 and POSIX thread support.
Here are some links I like related to thread libraries and implementations.
Interesting article on semaphores also some source code examples:
http://preshing.com/20150316/semaphores-are-surprisingly-versatile/
Article on benaphores with sample code:
http://preshing.com/20120226/roll-your-own-lightweight-mutex/
Recursive mutex using benaphores with sample code:
http://preshing.com/20120305/implementing-a-recursive-mutex/
Haiku - articles on Condition Variables
https://www.haiku-os.org/legacy-docs/benewsletter/Issue4-39.html
https://www.haiku-os.org/legacy-docs/benewsletter/Issue4-40.html
pthreads-win32
http://sourceware.org/pthreads-win32/
Bionic C library pthreads implementation
https://android.googlesource.com/platform/bionic/+/master/libc/bionic/
Haiku pthread implementation
https://github.com/luciang/haiku/tree/master/src/system/libroot/posix/pthread
TinyCThread
C11 threads implementation
https://tinycthread.github.io/
c11threads
GNU compatibility headers for C11 thread support
https://github.com/jtsiomb/c11threads
Upthreads
A user space implementation of the POSIX thread library implemented using setjmp/longjump (or equivalent).
http://upthread.sourceforge.net/