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]

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


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


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