public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Re: High Activity of setprogname
Date: Thu, 19 May 2011 19:11:00 -0000	[thread overview]
Message-ID: <20110519191111.GB15673@ednor.casa.cgf.cx> (raw)
In-Reply-To: <4DD5565B.1070607@ece.cmu.edu>

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

      reply	other threads:[~2011-05-19 19:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTimbvqQbyWYmcu-YUAaGLOgCtv7nyQ@mail.gmail.com>
2011-05-19  4:37 ` Sravan Bhamidipati
2011-05-19 17:42   ` Ryan Johnson
2011-05-19 19:11     ` Christopher Faylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110519191111.GB15673@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).