emacs-devel
[Top][All Lists]
Advanced

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

Re: Concurrency via isolated process/thread


From: Ihor Radchenko
Subject: Re: Concurrency via isolated process/thread
Date: Sun, 09 Jul 2023 14:16:31 +0000

Eli Zaretskii <eliz@gnu.org> writes:

>> Of course, if there are breaking future changes on C level will need to
>> account for concurrency.
>
> Who will remember that we at some point "assumed" buffer->base_buffer
> can change _only_ in make-indirect-buffer?

Ok. So, in other words, we need to make sure that any changes in a
buffer and also in indirect buffers will lock.
Trying to be more granular is not reliable.

>> So, redisplay will have access to correct local values.
>
> No, it won't, because redisplay runs only in the main thread,
> remember?  So it will not see changes to Vfoo done by other threads.
> This could sometimes be good (e.g., if the changes are temporary), but
> sometimes bad (if the changes are permanent).

If redisplay is about to display buffer that is being modified
(including its buffer-local values), it will have to lock until the
modification is done. Same for global Lisp variables.

>> > What do you expect redisplay to do when some thread moves point in a
>> > way that it is no longer in the window?
>> 
>> Async threads will not trigger redisplay. And they will have their own
>> PT, BEGV, and ZV.
>
> This goes back to the other sub-thread, where we discussed how to show
> and prompt the user from non-main threads.  The conclusion was that
> there is no good solution to that.  The best proposal, wait for the
> main thread, would mean that stuff like stealth fontifications, which
> currently run from timers, cannot be run from a thread.

May you provide a link?
I am not sure how independent PT+buffer in different threads affects
prompts.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

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