delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/03/16/19:16:22

X-Spam-Check-By: sourceware.org
Date: Fri, 16 Mar 2007 20:16:33 -0400
From: alex <alex AT zoosmart DOT us>
To: cygwin AT cygwin DOT com
Subject: Re: pthread question - should this program run - does on Linux
Message-ID: <20070317001633.GA19379@zoosmart.us>
References: <VA DOT 00001550 DOT 00852aa3 AT thesoftwaresource DOT com>
Mime-Version: 1.0
In-Reply-To: <VA.00001550.00852aa3@thesoftwaresource.com>
User-Agent: Mutt/1.4.2.1i
X-Spam-Score: -4.398 () ALL_TRUSTED,BAYES_00,DK_POLICY_SIGNSOME
X-Bayes-Score: 0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I got this (cygwin):

$ ./a
Starting main now
Creating thread 0

0: hello world!
Creating thread 1

1: hello world!
Creating thread 2

2: hello world!
Creating thread 3

3: hello world!
Creating thread 4

4: hello world!

then the program exit

On Fri, Mar 16, 2007 at 02:14:40PM -0400, Brian Keener wrote:
> I have been trying to get a grasp on some pthread usage starting with a couple 
> simple programs.  I found this one and tried on Cygwin and didn't get what I 
> expected so I tried in Linux and it worked there.  I know I have seen a lot on 
> the archives about thread usage and that some things do not work (like stack 
> size and stack addr) but I have also seen comments on if used properly then 
> threads do work.  
> 
> I have compiled my simple program in Cygwin and Linux as 
> 
> g++ mythread_simple.cpp -o mythread_simple.exe
> 
> In Cygwin I when I compile I get this 
> 
> BrianK AT atl-lt-5783 /usr/tmp
> $ ./mythread_simple
> Starting main now
> Creating thread 0
> 
> 0: hello world!
> Creating thread 1
> Creating thread 2
> Creating thread 3
> Creating thread 4
> 
> At this point I have to hit CTRL-C to break out.  And when I run in in linux I 
> get 
> 
> Starting main now
> Creating thread 0
> Creating thread 1
> Creating thread 2
> Creating thread 3
> Creating thread 4
> 
> 0: hello world!
> 
> 1: hello world!
> 
> 2: hello world!
> 
> 3: hello world!
> 
> 4: hello world!
> 
> Which is what I would expect.  I have attached the program and my cygcheck log. 
> Any information, confirmation or assistance greatly appreciated.
> 
> bk
> 
> 
> 



> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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