From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1623 invoked by alias); 19 May 2011 17:42:02 -0000 Received: (qmail 1614 invoked by uid 22791); 19 May 2011 17:42:02 -0000 X-SWARE-Spam-Status: No, hits=1.8 required=5.0 tests=AWL,BAYES_00,TW_DB,TW_RX,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from BACHE.ECE.CMU.EDU (HELO bache.ece.cmu.edu) (128.2.129.23) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 17:41:48 +0000 Received: from [10.70.1.13] (sb-gw15.cs.toronto.edu [128.100.3.15]) by bache.ece.cmu.edu (Postfix) with ESMTP id 01FF8296; Thu, 19 May 2011 13:41:47 -0400 (EDT) Message-ID: <4DD5565B.1070607@ece.cmu.edu> Date: Thu, 19 May 2011 17:42:00 -0000 From: Ryan Johnson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Sravan Bhamidipati CC: cygwin@cygwin.com Subject: Re: Re: High Activity of setprogname References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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/msg00287.txt.bz2 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. Ryan P.S. Windows has no clue about gcc's symbols, which is why you got setprogname+0x2620 instead of something that made sense. -- 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