delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/24/04:39:18

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Fri, 24 Sep 2004 10:40:05 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: printf output missing in multi-threaded program
Message-ID: <20040924084005.GU12802@cygbert.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <200409240720 DOT i8O7Ka2a003068 AT tyr DOT informatik DOT fh-fulda DOT de>
Mime-Version: 1.0
In-Reply-To: <200409240720.i8O7Ka2a003068@tyr.informatik.fh-fulda.de>
User-Agent: Mutt/1.4.2i

On Sep 24 09:20, Siegmar Gross wrote:
> Hi,
> 
> some of my multi-threaded programs don't print everything they should.
> I have for example a small program to show that LinuxThreads don't
> behave like real POSIX threads concerning "fork()" (only the thread
> which creates a child process can wait for its termination with
> LinuxThreads). When I run the program on Solaris I get the following
> output:
> 
> gorbag work 23 fork_thr                          !!!! Solaris
> Thread thr_fork: forking a child process.
> Child process: I'm sleeping for 2 seconds.
> Thread thr_wait: sleeping for 5 seconds.
> Thread thr_fork: sleeping for 10 seconds.
> Child process: terminating.
> Thread thr_wait: try to wait for child process.
> Thread thr_wait: child terminated.
> Thread thr_fork: try to wait for my child.       !!!!!! missing in Cygwin
> Thread thr_fork: No child processes              !!!!!! missing in Cygwin
> gorbag work 24 
> 
> 
> When I compile and run the program on Cygwin the last output from
> "thr_fork" will not be displayed. I've upgraded Cygwin to the latest
> version yesterday. "cygcheck -c" displays that all packages are OK. Cygwin
> is installed on Windows XP with all updates excluding SP2.
> 
> eiger src 4 fork_thr
> Thread thr_fork: forking a child process.        !!!! Cygwin
> Thread thr_wait: sleeping for 5 seconds.
> Thread thr_fork: sleeping for 10 seconds.
> Child process: I'm sleeping for 2 seconds.
> Child process: terminating.
> Thread thr_wait: try to wait for child process.
> Thread thr_wait: child terminated.
> eiger src 5 

That's what I get with a recent Cygwin snapshot:

Thread thr_fork: forking a child process.
Thread thr_wait: sleeping for 5 seconds.
Thread thr_fork: sleeping for 10 seconds.
Child process: I'm sleeping for 2 seconds.
Thread thr_fork: 1 s of sleeping time passed
Thread thr_fork: 2 s of sleeping time passed
Child process: terminating.
Thread thr_fork: 3 s of sleeping time passed
Thread thr_fork: 4 s of sleeping time passed
Thread thr_wait: try to wait for child process.
Thread thr_wait: child terminated.
Thread thr_fork: 5 s of sleeping time passed
Thread thr_fork: 6 s of sleeping time passed
Thread thr_fork: 7 s of sleeping time passed
Thread thr_fork: 8 s of sleeping time passed
Thread thr_fork: 9 s of sleeping time passed
Thread thr_fork: 10 s of sleeping time passed
Thread thr_fork: try to wait for my child.
Thread thr_fork: No child processes

Looks ok, doesn't it?

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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