all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: Eli Zaretskii <eliz@gnu.org>,
	Daniel Colascione <dancol@dancol.org>,
	Emacs-devel@gnu.org
Subject: Re: Power: blink-cursor-mode is a pig
Date: Sat, 31 Dec 2011 11:59:56 +0100	[thread overview]
Message-ID: <EEF4AB04-AFD5-4EB9-95AD-AA0B8BA9E583@swipnet.se> (raw)
In-Reply-To: <E6C83B44-E460-449F-AC67-9B9203F1A839@math.s.chiba-u.ac.jp>

Hello.

31 dec 2011 kl. 08:42 skrev YAMAMOTO Mitsuharu:

> 
> On 2011/12/31, at 16:21, Daniel Colascione wrote:
> 
>> On 12/30/11 11:10 PM, Eli Zaretskii wrote:
>>>> From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
>>>> Date: Sat, 31 Dec 2011 12:47:19 +0900
>>>> Cc: dancol@dancol.org,
>>>> Emacs-devel@gnu.org
>>>> 
>>>> BTW, stopping/suspending timers does not avoid Emacs to wake up
>>>> in a short period on some ports, depending on how its `select'
>>>> emulation is implemented.  At least, this applies to the NS port
>>>> because it does periodic polling inside its `select'
>>>> implementation when there are some subprocesses or network
>>>> connections.
>> 
>> Why? Some Cocoa limitation?
> 
> I don't know for sure.  Maybe for compatibility with GNUstep?
> 
> The Mac port uses either Grand Central Dispatch (on Mac OS X 10.6
> or later) or Pthreads with CFRunLoopSource so as to avoid
> periodic polling in the `select' emulation.  IIUC, both are
> specific to Mac OS X, if not Carbon.

The CF suggests Core Foundation, so it is not Carbon specific (but still OSX specific).
An alternative for OSX would be to use CFFileDescriptor, but that is 10.5 or later.
I think the current ns-select tries to work on GNUStep also.  But the polling it does is not good for performance, it accounts for half of the slowdown flyspell-buffer (for example) currently sees in the NS-port.

Going back to select, there used to be a half a second timeout added to select (if the current timer timeout was longer) to handle timeouts that various toolkits use for example menu activation and scrollbar repeats.  As Emacs are/was not using the toolkit specific event loop, those timeouts where missing.  This was mostly Motif and Gtk+.  I think we don't do that anymore.  For the Gtk+ case we now use the Gtk+ event handling.  For Motif, we add the timeout when we know there is a menu activation or a scroll in progress, and remove it afterwards.  So there should be no polling going on if blink-cursor if off and Emacs is idle.

	Jan D.






  reply	other threads:[~2011-12-31 10:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 23:54 Power: blink-cursor-mode is a pig Daniel Colascione
2011-12-30  3:55 ` Lennart Borgman
2011-12-30 16:54   ` Richard Stallman
2011-12-30  9:10 ` Eli Zaretskii
2011-12-30  9:19   ` Lennart Borgman
2011-12-30  9:20   ` Daniel Colascione
2011-12-30 11:42     ` Eli Zaretskii
2011-12-30 11:58       ` Daniel Colascione
2011-12-30 12:39         ` Daniel Colascione
2011-12-30 15:32         ` Eli Zaretskii
2011-12-30 12:49       ` 山本 光晴
2011-12-30 15:35         ` Eli Zaretskii
2011-12-31  3:47           ` YAMAMOTO Mitsuharu
2011-12-31  7:10             ` Eli Zaretskii
2011-12-31  7:21               ` Daniel Colascione
2011-12-31  7:42                 ` YAMAMOTO Mitsuharu
2011-12-31 10:59                   ` Jan Djärv [this message]
2011-12-31  7:42                 ` Eli Zaretskii
2011-12-30 14:37   ` David De La Harpe Golden
2011-12-30 15:37     ` Eli Zaretskii
2011-12-30 13:57 ` Thien-Thi Nguyen
2011-12-30 14:46   ` Óscar Fuentes
2011-12-31 18:04 ` Chong Yidong
2011-12-31 18:11   ` Lennart Borgman
  -- strict thread matches above, loose matches on Subject: below --
2011-12-31 12:00 grischka
2011-12-31 14:40 ` Eli Zaretskii

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=EEF4AB04-AFD5-4EB9-95AD-AA0B8BA9E583@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=Emacs-devel@gnu.org \
    --cc=dancol@dancol.org \
    --cc=eliz@gnu.org \
    --cc=mituharu@math.s.chiba-u.ac.jp \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.