[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.
- Re: Questions about throw-on-input, (continued)
- Re: Questions about throw-on-input, Alexander Miller, 2020/05/10
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/11
- Re: Questions about throw-on-input, Stefan Monnier, 2020/05/11
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/11
- Re: Questions about throw-on-input, Stefan Monnier, 2020/05/11
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/11
- Re: Questions about throw-on-input, Alexander Miller, 2020/05/11
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/11
- Re: Questions about throw-on-input, Stefan Monnier, 2020/05/11
- Re: Questions about throw-on-input,
Alexander Miller <=
- Re: Questions about throw-on-input, Stefan Monnier, 2020/05/11
- Re: Questions about throw-on-input, Alexander Miller, 2020/05/12
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/13
- Re: Questions about throw-on-input, Alexander Miller, 2020/05/13
- Re: Questions about throw-on-input, Philipp Stephani, 2020/05/14
- Re: Questions about throw-on-input, Eli Zaretskii, 2020/05/14
- Re: Questions about throw-on-input, Philipp Stephani, 2020/05/14
- RE: Questions about throw-on-input, Drew Adams, 2020/05/14
- Re: Questions about throw-on-input, Richard Stallman, 2020/05/14
- Re: Questions about throw-on-input, Stefan Monnier, 2020/05/14