[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs design and architecture. How about copy-on-write?
From: |
Ihor Radchenko |
Subject: |
Re: Emacs design and architecture. How about copy-on-write? |
Date: |
Wed, 20 Sep 2023 12:09:24 +0000 |
Eli Zaretskii <eliz@gnu.org> writes:
>> My solution (which I've put into practice in redisplay) is to save those
>> values before sensitive code is executed, and to refer to those saved
>> values within said code.
>
> That is _everyone's_ solution, not just yours. But it is not as easy
> in practice as it may sound. E.g., imagine a subroutine that is
> called by some higher-level functions, where both the callers and the
> subroutine need to access the same variable. When other threads are
> running, there's no longer a guarantee that both the caller and the
> callee will see the same value of that variable. If they must use the
> same value, you now need to pass that variable to the callee via its
> API, and this is not scalable when you have more than a couple,
> especially if the callee is not called directly, but via several
> intermediate callers.
May the state be captured and passed to the callee under the hood?
Something like forking, but using thread-local state.
For lexical bindings, it is just a matter of passing over current
Vinternal_interpreter_environment; and for global bindings, it is a
matter of passing whatever is altered by the caller thread (with
copy-on-write, this info should be available).
--
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>
- Re: Emacs design and architecture. How about copy-on-write?, (continued)
- Re: Emacs design and architecture. How about copy-on-write?, Po Lu, 2023/09/21
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- RE: [External] : Re: Emacs design and architecture. How about copy-on-write?, Drew Adams, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Po Lu, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Po Lu, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/20
- Re: Emacs design and architecture. How about copy-on-write?,
Ihor Radchenko <=
- Re: Emacs design and architecture. How about copy-on-write?, Po Lu, 2023/09/20
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/20
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/22
- Re: Emacs design and architecture. How about copy-on-write?, tomas, 2023/09/22