Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Thu, 25 Aug 2005 15:14:02 +0200
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Problems with Windows threads and cygwin sleep()
Message-ID: <20050825131402.GR17452@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <Pine.LNX.4.62.0508241458460.26825@ns.pyerotechnics.com> <430D688D.1070205@vihmapuu.ee> <Pine.CYG.4.58.0508251054550.1272@mordor> <430D8FC8.8090906@vihmapuu.ee> <20050825100234.GL17452@calimero.vinschen.de> <430DA017.5000402@vihmapuu.ee> <20050825115019.GP17452@calimero.vinschen.de> <Pine.CYG.4.58.0508251456520.2676@mordor> <20050825120922.GQ17452@calimero.vinschen.de> <Pine.CYG.4.58.0508251532350.2968@mordor>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <Pine.CYG.4.58.0508251532350.2968@mordor>
User-Agent: Mutt/1.4.2i

On Aug 25 15:40, Pavel Tsekov wrote:
> Hello,
> 
> On Thu, 25 Aug 2005, Corinna Vinschen wrote:
> 
> > > Here when the app is compiled with -mno-cygwin it takes 100% cpu when it
> > > allocates 400+ threads - both from Windows Command Prompt and Cygwin bash.
> > > After all the testcase consist almost entirely of Win32 calls.
> >
> > You're on W2K, I'm on XP, maybe there's a difference?  I can easily
> > reproduce nearly 0% CPU with 1000 threads if no Cygwin process is
> > present and nearly 99% if a Cygwin process is present.
> >
> > Even if we can't do much about it, it would be interesting to find out
> > how Cygwin affects CPU usage of non-Cygwin processes.
> 
> Stopping all Cygwin dependent programs helps here too - the program runs
> fine. I forgot sshd, cygserver and inetd. I did some further testing -
> here are the results:
> 
> 1) Bash in Cygwin console
> 
>    CPU usage is ok
> 
> 2) Bash in rxvt (W11)
> 
>   CPU usage 99 %
> 
> 3) inetd started as service with no clients connected
> 
>   CPU usage is ok
> 
>   When a client is connected CPU goes 99%
> 
> 4) sshd started as service (doesn't matter if there are connected clients)
> 
>   CPU usage 99 %
> 
> The tests were performed with no other Cygwin programs running and
> threads.exe running in command prompt. Each time I would stop all involved
> programs and start them again.
> 
> Perhaps ptys are involved ?!

No, I tested with just two cmd windows.  The joke is that I don't see
the Cygwin process doing anything suspicious.  In my test I just started
tcsh under strace to see if it begins to behave weird when the threads
application is running, but it just waits in ready_for_read for user input.
Nevertheless, threads takes the CPU time when the no. of threads is big
enough and returns to normal when the Cygwin process stops.  I tried a
few things but no luck so far.  Maybe Dave is right.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          mailto:cygwin@cygwin.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/

