delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/13/10:17:45

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <032401c0c424$584cf880$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: "Billinghurst, David \(CRTS\)" <David DOT Billinghurst AT riotinto DOT com>,
<cygwin AT cygwin DOT com>
References: <8D00C32549556B4E977F81DBC24E985DC80C AT crtsmail1 DOT technol_exch DOT corp DOT riotinto DOT org>
Subject: Re: pthreads update for the adventurous
Date: Sat, 14 Apr 2001 00:16:32 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-OriginalArrivalTime: 13 Apr 2001 14:09:47.0870 (UTC) FILETIME=[65E3C7E0:01C0C423]

Thanks David,
    I'm just heading off to bed now... so look for an update in ~ 9-10
hours (getting pthreads stable is a priority for me this weekend).

  I suspect the bug lies in main() exiting via pthread_exit(). Can you
try having main just return ?

Rob



----- Original Message -----
From: "Billinghurst, David (CRTS)" <David DOT Billinghurst AT riotinto DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Friday, April 13, 2001 10:55 PM
Subject: RE: pthreads update for the adventurous


> OK.  I'll bite.
>
> I have built cygwin1.dll from cvs, then proceeded to build and test
gcc-3.0
> with --enable-threads=posix.  This seems to work OK.
>
> I then tried example 1 from
>
http://www.llnl.gov/computing/tutorials/workshops/workshop/pthreads/MAIN
.htm
> l (below) using standard cygwin gcc-2.95.3-2 and the gcc-3.0 I built.
There
> appears to be a problem with pthread_exit() as the program never
exits.  I
> tried to debug this, but soon got lost.
>
>
>
>
/***********************************************************************
****
> ***
> * FILE: hello.c
> * DESCRIPTION:
> *   A "hello world" Pthreads program.  Demonstrates thread creation
and
> *   termination.
> *
> * SOURCE:
> * LAST REVISED: 9/20/98 Blaise Barney
>
************************************************************************
****
> **/
>
> #include <pthread.h>
> #include <stdio.h>
> #define NUM_THREADS 5
>
> void *PrintHello(void *threadid)
> {
>    printf("\n%d: Hello World!\n", threadid);
>    pthread_exit(NULL);
> }
>
> int main()
> {
>    pthread_t threads[NUM_THREADS];
>    int rc, t;
>    for(t=0;t<NUM_THREADS;t++){
>       printf("Creating thread %d\n", t);
>       rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
>       if (rc){
>          printf("ERROR; return code from pthread_create() is %d\n",
rc);
>          exit(-1);
>       }
>    }
>    pthread_exit(NULL);
> }
>
>
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
>
>


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019