unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Johan Andersson <johan.andersson@burtcorp.com>
To: Daniel Colascione <dancol@dancol.org>
Cc: 24849@debbugs.gnu.org
Subject: bug#24849: Is Emacs put in idle mode when window is not focused?
Date: Tue, 1 Nov 2016 21:33:59 +0100	[thread overview]
Message-ID: <CAF4YyTp9ywu85eEfdLZ9CesMJa=_L6fFdb7mXvEjP9aQcR6qVw@mail.gmail.com> (raw)
In-Reply-To: <d6285435-876b-46c7-f254-69e0e4cbec6d@dancol.org>

[-- Attachment #1: Type: text/plain, Size: 3481 bytes --]

> BTW: please don't top-post

Sorry, what?

> Are you sure that your subprocess isn't buffering its output?

No. Does that make a difference?

> Can you catch Emacs in the act?

What do you mean?

> Assuming GNU/Linux here.

On a Mac here, but I might be able to find a GNU/Linux machine at work tomo.

On Tue, Nov 1, 2016 at 9:28 PM, Daniel Colascione <dancol@dancol.org> wrote:

> BTW: please don't top-post
>
> On 11/01/2016 01:18 PM, Johan Andersson wrote:
>
>> I added the set-process-filter in case that would make a difference, but
>> I don't think that is the issue here. The issue is that the services
>> (sub processes of Emacs as you say) takes a long time to respond when
>> Emacs is idle. If I run the same command from a terminal, that doesn't
>> happen.
>>
>
> Are you sure that your subprocess isn't buffering its output?
>
> Can you catch Emacs in the act?
>
> (Assuming GNU/Linux here.) Run emacs with "strace -s256 -o trace -ff -tt
> emacs" and look at the trace.* files produced. You should have one for each
> thread in each process. You should be able to identify the process involved
> from the system calls in each. (Look for execve.) Now, look for the
> write(2) system call from your subprocess and see how much time passes
> between that system call and Emacs waking up from pselect.
>
> If Emacs wakes up very soon after that write(2), the problem lies in your
> code. If there is a big delay between that write(2) and Emacs returning
> from pselect, the problem is likely in Emacs.
>
>
>> On Tue, Nov 1, 2016 at 9:13 PM, Eli Zaretskii <eliz@gnu.org
>> <mailto:eliz@gnu.org>> wrote:
>>
>>     > From: Johan Andersson <johan.andersson@burtcorp.com
>>     <mailto:johan.andersson@burtcorp.com>>
>>     > Date: Tue, 1 Nov 2016 20:48:59 +0100
>>     > Cc: 24849@debbugs.gnu.org <mailto:24849@debbugs.gnu.org>
>>     >
>>     > (let* ((default-directory "/tmp")
>>     > (process (start-process "server" nil "python" "-m"
>> "SimpleHTTPServer" "8000")))
>>     > (set-process-filter
>>     > process
>>     > (lambda (_ output)
>>     > ;; ...
>>     > )))
>>     >
>>     > What happens in practice is that, when I get to work, I select the
>> services I need and start them (unless
>>     > Emacs was killed, they are already started). Sometimes I use Emacs
>> quite frequently and then this is not so
>>     > much of an issue because Emacs does not have time to idle. But when
>> I don't use Emacs for a while, it will
>>     > hang waiting for the response from the service (because Emacs is
>> idle).
>>
>>     So you are saying that the service, which is a sub-process of Emacs,
>>     produces some output, but Emacs doesn't read that output timely enough
>>     because it's idle?  That's not possible, I think: when Emacs is idle,
>>     it is most of the time stuck inside a call to 'pselect', which should
>>     return immediately when some input arrived from a sub-process.
>>
>>     So I guess I still don't understand something in your setup.  But
>>     what?
>>
>>
>>
>>
>> --
>> Johan Andersson
>> System Developer, Burt
>> www.burtcorp.com <http://www.burtcorp.com>
>> Cell: +46 761 041607
>> https:// <http://twitter.com/rejeep>github.com/rejeep
>> <http://github.com/rejeep> | http://twitter.com/rejeep |
>> http://twitter.com/burtcorp
>>
>


-- 
Johan Andersson
System Developer, Burt
www.burtcorp.com
Cell: +46 761 041607
https:// <http://twitter.com/rejeep>github.com/rejeep |
http://twitter.com/rejeep | http://twitter.com/burtcorp

[-- Attachment #2: Type: text/html, Size: 6779 bytes --]

  reply	other threads:[~2016-11-01 20:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01  8:44 bug#24849: Is Emacs put in idle mode when window is not focused? Johan Andersson
2016-11-01 16:22 ` Eli Zaretskii
2016-11-01 19:48   ` Johan Andersson
2016-11-01 20:13     ` Eli Zaretskii
2016-11-01 20:18       ` Johan Andersson
2016-11-01 20:28         ` Daniel Colascione
2016-11-01 20:33           ` Johan Andersson [this message]
2016-11-01 20:37             ` Daniel Colascione
2016-11-01 20:41               ` Johan Andersson
2016-11-01 20:44                 ` Daniel Colascione
2016-11-01 20:51                   ` Johan Andersson
2016-11-01 23:25             ` Alan Third
2016-11-02  8:00               ` Johan Andersson
2016-11-01 20:45         ` Eli Zaretskii
2016-11-01 20:52           ` Johan Andersson
2016-11-02  2:18 ` Richard Stallman
2016-11-02  8:10   ` Johan Andersson

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAF4YyTp9ywu85eEfdLZ9CesMJa=_L6fFdb7mXvEjP9aQcR6qVw@mail.gmail.com' \
    --to=johan.andersson@burtcorp.com \
    --cc=24849@debbugs.gnu.org \
    --cc=dancol@dancol.org \
    /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 public inbox

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

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).