[mercury-users] parallel grades in windows

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Oct 27 16:48:12 AEDT 2010


Hi,

On Wed, 27 Oct 2010, Sergey Khorev wrote:

>> Defining GC_WIN32_THREADS is the correct thing to do if you want to use
>> native Win32 threads;  you are correct that it should be
>> GC_WIN32_PTHREADS if you using one of the libraries that provides POSIX
>> threads on Windows.
>
> Does Mercury support native Win32 thread API at all? I was not able to
> find either of _beginthreadex or CreateThread in the sources.

Mercury doesn't, it requires POSIX threads at the moment; the Boehm
collector does.  (The GC_* macros only affect the latter.)

> And, if it just about using thread-safe Boehm GC, it automatically
> defines GC_WIN32_THREADS if GC_WIN32_PTHREADS is defined.

Yes, but it doesn't automatically define GC_WIN32_PTHREADS, in fact it
requires that it be set explicitly.

from boehm_gc/doc/README.win32:

     To build the collector for Mingw32 Pthreads, use Makefile.direct and
     explicitly set GC_WIN32_PTHREADS.

and from boehm_gc/doc/README.macros:

     GC_WIN32_THREADS        Enables support for win32 threads.  That makes
                             sense for this Makefile only under Cygwin.

     GC_WIN32_PTHREADS       Enables support for Ming32 pthreads.  This
     cannot be enabled automatically by GC_THREADS, which would assume Win32 native
     threads.

Cheers,
Julien.


More information about the users mailing list