Questions tagged [pthreads-win32]

pthreads-win32 provides an implementation of pthreads for Win32.

pthread-win32 - The POSIX 1003.1-2001 standard defines an application programming interface (API) for writing multithreaded applications. This interface is known more commonly as pthreads. A good number of modern operating systems include a threading library of some kind: Solaris (UI) threads, Win32 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 woes.

Win32 does not, and is unlikely to ever, support pthreads natively. 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 Win32.

Level of standards conformance

Pthreads-win32 currently implements a large subset of the POSIX standard threads related API. See our conformance page for a complete list of options and functions implemented as well as those that aren't.

HTML formatted manual pages are now available inside the package and on this site. Peruse them for additional Pthreads-win32 information.

How does it work?

The Win32 pthreads is normally implemented as a dynamic link library (DLL). This has some notable advantages from the Win32 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.

Official Website: http://www.sourceware.org/pthreads-win32/

Useful Linkes:

52 questions
11
votes
3 answers

Portability of pthreads-win32 over various windows compilers

I'm using pthreads-win32 to allow threading support for windows. I have a cross platform project that uses pthreads and I want to make it work on windows with various compilers and different OS versions. At least, according to the documentation…
Artyom
  • 31,019
  • 21
  • 127
  • 215
7
votes
1 answer

pthreads for PHP not executing parallel threads in Apache

I'm using the pthreads extension for PHP. When I execute the PHP script from cmd on Windows I get parallel threads but when I call the same script from Apache I get a different result and it seems to me like single thread execution. Is there any…
Emrah Mehmedov
  • 1,492
  • 13
  • 28
5
votes
1 answer

pthreads static linking with MinGW

I would like to statically link "pthreads for Win32" with my application, compiled with MinGW32 so the app won't need pthreadGC2.dll to run. I'm using the latest release of pthreads - 2.9.1, downloaded from here and lib and include files are copied…
seladb
  • 852
  • 1
  • 13
  • 29
4
votes
1 answer

Problems with pthreads in PHP

I have a problem with pthreads in PHP. When I start apache I see error like this: php.exe - Entry point not found The procedure entry point was not found _zend_hash_update@@12 in library D:\xampp\php\ext\php_pthreads.dll When I execute script in…
Stan Fortoński
  • 348
  • 6
  • 13
4
votes
1 answer

pthread win32 version? (Mongoose)

Please tell me what difference between pthread versions: VC2, VCE2 and VSE2? How to choose which of them I must use with Visual C++ Express 2010 for Mongoose webserver library? Thank you!!!
Edward83
  • 6,664
  • 14
  • 74
  • 102
4
votes
4 answers

pthread-win32 extension sem_post_multiple

I am currently building a thin C++ wrapper around pthreads for in-house use. Windows as well as QNX are targeted and fortunately the pthreads-win32 ports seems to work very well, while QNX is conformant to POSIX for our practical purposes. Now,…
Arne
  • 1,111
  • 2
  • 11
  • 22
4
votes
1 answer

pthread, pthread on windows, pthread trouble , linker errors, pthread linker error on msvc 2008/2010

I am running a pthread on MSVC 2010 and I have include pthreadVC2 .lib & .dll . from below site http://sourceware.org/pthreads-win32/ http://web.cs.du.edu/~sturtevant/pthread.html but i am getting these error can any one educate me on this…
4
votes
1 answer

I can't use pthread in window platform

My env is Windows8.1 (64bit) and using Visual Studio 2010. I did put all *.dll files in system32 , SYSWOW64(because I use win8 64bit.) and link location where *.lib file for x64-system with VC 2010. of course, I add additional folder lib forders.. ,…
KORCJ
  • 51
  • 1
  • 4
3
votes
4 answers

How to run Pthreads on windows

I used to use a mac to write some C programs but it's not working now. I have to use an old windows laptop for a while. I installed codeblocks and tested a simple program using Pthreads. Unfortunately it didn't work. pthread_create(&thrd1, NULL,…
Shwnwil
  • 57
  • 1
  • 1
  • 4
3
votes
2 answers

Installing pthread win32

I tried to install pthread win32 according to this guide. I added the pthreadVC2.dll file to C:\Windows and the pthreadVC2.lib file to C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\lib. I typed pthreadVC2.lib in additional dependencies in…
Adi Malachi
  • 69
  • 2
  • 6
2
votes
0 answers

pthreads-win32 2.10 pre-built lib/dll for x86 and x64

I'm trying to find pre-built libs and dlls for pthreads-win32 v2.10 (a.k.a pthreads4w) for both x86 and x64, something similar to the ones existing for v2.9.1 The source code does exist in the project's web-site but the only pre-built version I…
seladb
  • 852
  • 1
  • 13
  • 29
2
votes
5 answers

Pthread win32 libraray, PTHREAD_PROCESS_SHARED not supported

I am using pthread win32 library to implement mqueue. But when it runs into following code, it throw #40 error should be ENOSYS, means system not supported. pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED); i =…
Alex.Yang
  • 419
  • 1
  • 6
  • 11
2
votes
1 answer

On window x64 build of example crashing at pthread_cancel and pthread_join

I have create small program which is working with pthreadVC.lib which is Win32 version. I am using visual studio 2013. When I have changed program setting for x64 od same program and then I have linked pthreadVC2.lib (which for x64 configuration)…
Mohan
  • 1,871
  • 21
  • 34
2
votes
1 answer

Is it a Must to use both pthreadVC2.lib and pthreadVC2.dll in visual studio 2013?

I download pthread-w32-2-9-1-release.zip, unzip it and use Prebuild/include lib and dll with VisualStudio2013. I set up a VC++ empty project "helloc" with main.c, then write a simple example with pthread_create pthread_join functions. This is my…
linrongbin
  • 2,967
  • 6
  • 31
  • 59
2
votes
1 answer

pthread static linking with application in visual studio 2013

I want to pthread lib statically linked with my application so that at other target without install pthread lib my .exe will run. For that I have add pthreadVC.lib in Linker->input->additional dependency of visual studio and also given correct path…
Mohan
  • 1,871
  • 21
  • 34
1
2 3 4