bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple multithread program fails on Cygwin, succeeds on Linux


From: Bruno Haible
Subject: Re: simple multithread program fails on Cygwin, succeeds on Linux
Date: Wed, 12 Aug 2009 16:31:02 +0200
User-agent: KMail/1.9.9

Eric Blake wrote, referring to 
<http://cygwin.com/ml/cygwin/2009-08/msg00283.html>:
> I don't know if you saw the other responses to this thread (the cygwin
> list has the annoying habit of setting headers such that reply-to-all
> excludes the original poster).

Indeed, I missed the answers since they did not CC me. Thanks for explaining.

> Basically, cygwin 1.5 has known bugs with 
> pthread, that have since been fixed in cygwin 1.7, and there is no plan to
> fix cygwin 1.5.

Well, then, it's probably best to disable the multithreading support on Cygwin
by default. For applications which use only locking and no 'gl_once_t', the
--enable-threads=posix switch might be usable; in other situations, maybe
--enable-threads=win32 works.

I'm applying this:


2009-08-12  Bruno Haible  <address@hidden>

        Disable multithread support by default on Cygwin 1.5.x.
        * m4/threadlib.m4 (gl_THREADLIB_EARLY_BODY): On Cygwin 1.5.x and older,
        set gl_use_threads=no if not specified otherwise.

--- m4/threadlib.m4.orig        2009-08-12 16:25:04.000000000 +0200
+++ m4/threadlib.m4     2009-08-12 16:06:57.000000000 +0200
@@ -1,4 +1,4 @@
-# threadlib.m4 serial 3 (gettext-0.18)
+# threadlib.m4 serial 4 (gettext-0.18)
 dnl Copyright (C) 2005-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -56,7 +56,16 @@
          dnl Disable multithreading by default on OSF/1, because it interferes
          dnl with fork()/exec(): When msgexec is linked with -lpthread, its
          dnl child process gets an endless segmentation fault inside execvp().
+         dnl Disable multithreading by default on Cygwin 1.5.x, because it has
+         dnl bugs that lead to endless loops or crashes. See
+         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
          osf*) gl_use_threads=no ;;
+         cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
      fi





reply via email to

[Prev in Thread] Current Thread [Next in Thread]