emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions about throw-on-input


From: Alexander Miller
Subject: Re: Questions about throw-on-input
Date: Mon, 11 May 2020 21:48:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

> Actually a better solution is often to run in a separate process
> (e.g. via `async.el`). That also lets you use the various CPU cores
> lying idle ;-)

async.el starts slowly, has no good way to read the current state
like text properties or buffer content, has no knowledge about loaded
libraries and incurs double serialization overhead. If just a Hello
World needs 70ms on my system imagine what it's like doing something
with org. That is far from ideal.

For context: I am mostly thinking about passive work in my treemacs
package that happens without any user interaction, like re-rendering on
changes in the file system or a file's tags, passively fontifying files
based on their git status after some directory node has been opened or
following the file the user is currently editing. All of that happens
passively, so I consider any perceptible delay a no-go. Being able to
just stop the git-fontify when the user types and later pick it up would
be a major help.

> I think calling `thread-yield` frequently enough should(!) do the trick.
> No need to call `input-pending-p`.
>
> IOW if `thread-yield` doesn't do the trick, you should
> likely `M-x report-emacs-bug`.

Yielding doesn't work for me, my input is ignored most of the time. I
will make my code emacs-q ready and open a bug report for it tomorrow.

> Sounds very credible, but I'll let someone else take care of this,
> because it's too far from my area of expertise.

Same for me I'm afraid.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]