From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15592 invoked by alias); 19 May 2011 19:11:29 -0000 Received: (qmail 15584 invoked by uid 22791); 19 May 2011 19:11:28 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,TW_DB,TW_RX,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from nm2-vm0.bullet.mail.sp2.yahoo.com (HELO nm2-vm0.bullet.mail.sp2.yahoo.com) (98.139.91.248) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 19 May 2011 19:11:13 +0000 Received: from [98.139.91.66] by nm2.bullet.mail.sp2.yahoo.com with NNFMP; 19 May 2011 19:11:13 -0000 Received: from [208.71.42.191] by tm6.bullet.mail.sp2.yahoo.com with NNFMP; 19 May 2011 19:11:13 -0000 Received: from [127.0.0.1] by smtp202.mail.gq1.yahoo.com with NNFMP; 19 May 2011 19:11:13 -0000 Received: from cgf.cx (cgf@173.48.46.160 with login) by smtp202.mail.gq1.yahoo.com with SMTP; 19 May 2011 12:11:12 -0700 PDT X-Yahoo-SMTP: jenXL62swBAWhMTL3wnej93oaS0ClBQOAKs8jbEbx_o- Received: from localhost (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 6FE5942804C for ; Thu, 19 May 2011 15:11:11 -0400 (EDT) Date: Thu, 19 May 2011 19:11:00 -0000 From: Christopher Faylor To: cygwin@cygwin.com Subject: Re: Re: High Activity of setprogname Message-ID: <20110519191111.GB15673@ednor.casa.cgf.cx> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <4DD5565B.1070607@ece.cmu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DD5565B.1070607@ece.cmu.edu> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-05/txt/msg00294.txt.bz2 On Thu, May 19, 2011 at 01:41:47PM -0400, Ryan Johnson wrote: >On 2:59 PM, Sravan Bhamidipati wrote: >> Terminals like mintty and rxvt are doing an unusual amount of context >> switching and consuming a lot of CPU cycles even in idle time. Process >> Explorer suggests that this activity is largely attributable to >> "cygwin1.dll!setprogname". Could this be something that should not or >> need not be done? (Running cygwin.bat directly to use Cygwin doesn't >> show such activity.) >> >> Most recently I've been seeing this behavior with Mintty v0.97, Cygwin >> v1.7.9-1, Windows 7 Ultimate SP1 (x64, Build Version: 6.1.7601 Service >> Pack 1 Build 7601). However I've noticed this in a few older versions >> of Mintty, Cygwin as well, even on Windows XP. >> >> You can also view the mintty thread where this discussion began: >> http://code.google.com/p/mintty/issues/detail?id=265 >The running code is related to select() (try running strace -mselect >mintty to see for yourself). > >A little poking around with windbg and gdb shows that select.cc:650 >(thread_pipe) is the culprit: select itself is called with infinite >timeout; somebody more knowledgeable than me will have to explain why >thread_pipe would return data so often for an idle process, however. It's called "polling", see: http://msdn.microsoft.com/en-us/library/aa365779%28v=vs.85%29.aspx cgf -- 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