Menu

Home

Ross Johnson
There is a newer version of this page. You can find it here.

What is this project about?

The Single Unix Specification (SUS) includes an application programming interface (API) for writing multithreaded applications previously known as the POSIX 1003.1-2001 standard. This interface is known more commonly as pthreads (POSIX threads). A good number of modern operating systems include a threading library of some kind: Solaris (UI) threads, Windows native threads, DCE threads, DECthreads, or any of the draft revisions of the pthreads standard. The trend is that most of these systems are slowly adopting the pthreads standard API, with application developers following suit to reduce porting effort.

Windows does not, and is unlikely to ever, support pthreads natively so this project seeks to provide a freely available and high-quality solution to this problem.

Various individuals have been working on independent implementations of this well-documented and standardised threading API, but most of them never see the light of day. The tendency is for people to only implement what they personally need, and that usually does not help others. This project attempts to consolidate these implementations into one implementation of pthreads for Windows.

How does it work?

Pthreads4w is normally implemented as a dynamic link library (DLL). This has some notable advantages from the Windows point of view, but it also more closely models existing pthread libraries on UNIX which are usually shared objects (e.g. libpthread.so). Please note though, that the library can also be built for static linking if necessary.

Is the implementation fast or slow, native or emulated?

Pthreads4w threads are based on Windows native threads whilst we provide our own native POSIX-compliant management and synchronisation objects (semaphores, mutexes, condition variables, reader-writer locks, barriers, etc.). These are not wrappers for their Windows native namesakes, for very good reasons: wrappers can't offer the level of SUS comformance or the speed that the Pthreads4w implementation does.

So you will find that, generally, Pthreads4w are just as fast as Windows native threads, and in several cases our synchronisation objects have lower overheads than their Windows namesakes. For example, Pthreads4w mutexes are nuch faster than Windows mutexes and very nearly as fast as CriticalSections.

Level of standards conformance

Pthreads4w currently implements a large subset of the SUSv3 threads related API. See our [Conformance] page for a complete list of options and functions implemented as well as those that aren't.

Mailing List

There is no project mailing list on sourceforge yet. We have a copy of the former pthreads-win32 list achives.

Acknowledgements

We would like to thank Ben Elliston for initiating the project, and John Bossom for providing us with his win32 pthreads implementation, which provided the near complete basis for this project.

Thanks to Xavier Leroy for granting permission to use and modify his LinuxThreads manual pages, and to the Open Group for their manual pages.

Thanks also to all past and present [Contributors].

Please also see the Acknowledgements section of the latest [Announcement] page.

Success stories

The library is being used in many projects either migrating from Unix platforms or developing cross-platform applications. These include commercial, research and other applications, many of which can be found via a Google search (e.g. try the keywords 'pthreads-win32' and 'requirements').