This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ANNOUNCEMENT] NEW: mingw-pthreads-20110507-1

The mingw-pthreads package provides Pthreads-W32, for use with the
MinGW cross toolchain.  Pthreads-W32 provides a POSIX-compliant pthreads
implementation for the Win32 platform.  The MinGW cross toolchain's
libgomp library, which provides openmp support for that compiler, is
linked against pthreadGC2.dll, as provided by this package.

!!!! WARNING !!!!
IF you are attempting to update an existing cygwin installation, which
has the gcc-mingw 'add-on' packages installed (*), then you MUST
upgrade the gcc-mingw packages to version 20050522-3 or newer, before
installing this package.  Do NOT attempt to upgrade gcc-mingw and
install this package during the same setup.exe event. The reason for
this restriction is fairly complex, and is detailed here:

If you are reading this announcement AFTER having messed up your cygwin
installation, because you didn't follow these instructions or didn't
know about them, then see the section in this message
that begins with "HELP!!!" and follow the suggestions there to "fix" it.

(*) gcc-mingw packages are "add-ons" to the gcc-3 compiler suite, and
    provide the necessary files for the -mno-cygwin mode of that
    compiler.  Ideally, this package and the accompanying
    i686-pc-mingw32 cross compiler will supplant the old
    'gcc-3 -mno-cygwin' mode.

*** NOTE ***
If you have installed the "missing" mingw cross compiler packages from
then you need take no special action.  This package will simply upgrade
the one.

Two versions of Pthreads-W32 are supplied:
  1. pthreadGC2.dll    (C cleanup code)
  2. pthreadGCE2.dll   (C++ cleanup code)
The first version is used by default. To use the GCE version, link
with -lpthreadGCE2 rather than -lpthreadGC or -lpthread.  Note that most
platforms' pthread implementations, even when used with C++, follow
the C cleanup model; that practice is also the recommended procedure in
this case, with the MinGW cross compiler.

To be perfectly clear: most users of the i686-pc-mingw32 cross compiler,
if they desire to exploit pthreads functionality, should use -lpthread
(which is the same as -lpthreadGC) regardless of language: C, C++, 
whatever. Furthermore, if you use the OpenMP (-fopenmp) features of GCC,
then you must link against the "normal" pthreads library, because libgomp
uses that version, and mixing the two versions is illadvised.  Only those
intrepid adventurers willing to brave the wilds of unusual, nay, wildly
unpredictable, behavior should attempt to use the GCE (-lpthreadGCE)
version -- and then, only if they are writing C++ programs.  Read the
pthreads-win32 documentation before experimenting with the C++ version.

The non-standard DLL names are used to match the versions distributed by
upstream Pthreads-W32. The DLLs are compiled using the same options as
the upstream build (e.g. GC-inline, GCE-inline).

There is a kernel mode driver that can be installed to (supposedly)
improve the conformance of pthreadGCE2.dll (that is, the version which
uses C++ cleanup code).  That driver eventually will be available from, but for now may be found here:
as QueueUserAPCEx-install.exe.  This executable is a handy Inno-Setup
installer for the i386, x86_64, and ia64 versions of the driver.
However, it has a number of issues -- not least of which is that I have
NOT found ANY conformance improvement with GCE *at all*!

First, the 64bit bit drivers are completely untested.  Second, Windows7
and Server2008 require all kernel mode drivers to be signed by a
certified CA, at least in their 64bit incarnations (I'm not sure about
the 32bit versions).  I don't have a signed certicate with which to sign
the driver -- and am not likely to ever get one.  So, it's a good thing
that even the GCE (C++ cleanup) version of libpthread works pretty well
even without this driver -- and the GC (C cleanup) version doesn't need
the driver at all, and achieves 100% compliance.

So...that's why the version of Pthreads-W32 which uses C cleanup is used
by default.  For the curious, more information about the alertdrv.sys
driver can be found at the following links:
and the release notes accompanying QueueUserAPCEx-install.exe.

Charles Wilson


To update your installation, click on the "Install Cygwin now" link
on the web page.  This downloads setup.exe to
your system.  Then, run setup and answer all of the questions.


If you want to unsubscribe from the cygwin-announce mailing list, look
at the "List-Unsubscribe: " tag in the email header of this message.
Send email to the address specified there.  It will be in the format:

If you need more information on unsubscribing, start reading here:

Please read *all* of the information on unsubscribing that is available
starting at this URL.

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]