This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: simple multithread program fails on Cygwin, succeeds on Linux
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 10 Aug 2009 13:30:15 +0200
- Subject: Re: simple multithread program fails on Cygwin, succeeds on Linux
- References: <200908101213.17744.bruno@clisp.org>
- Reply-to: cygwin at cygwin dot com
On Aug 10 12:13, Bruno Haible wrote:
> Hi,
>
> The attached test program for pthread_once uses the following basic POSIX
> threads functions:
> pthread_create
> pthread_join
> pthread_mutex_init
> pthread_mutex_lock
> pthread_mutex_unlock
> pthread_once
> pthread_rwlock_init
> pthread_rwlock_rdlock
> pthread_rwlock_unlock
> pthread_rwlock_wrlock
>
> On Linux with glibc 2.8:
> $ gcc bug.c -O -Wall -lpthread -o bug
> $ ./bug
> Starting test_once ... OK
> The test completes in about 4 seconds.
>
> On Cygwin 1.5.25(0.156/4/2):
> $ gcc bug.c -O -Wall -o bug.exe
> $ ./bug.exe
> Starting test_once ...
> Either it does not terminates (still running after half an hour, eating
> 100% CPU time on one of the two CPUs), or it crashes rather quickly:
> $ ./bug.exe
> Starting test_once ...Segmentation fault (core dumped)
WJFFM under Cygwin 1.7.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple