[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs design and architecture. How about copy-on-write?
From: |
Po Lu |
Subject: |
Re: Emacs design and architecture. How about copy-on-write? |
Date: |
Wed, 20 Sep 2023 21:35:49 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Po Lu <luangruo@yahoo.com> writes:
> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Does it mean that each threads contains a copy of the whole `globals'? I
>> think I proposed this in the linked thread and it was objected as
>> something taking a lot of memory.
>
> It incorporates one pointer for each field within globals itself. AFAIU
> that was the initial impetus for introducing struct emacs_globals in the
> first place.
>
>> IMHO, copy-of-write would be better here - only store the thread-local
>> values that are actually altered by the thread.
>
> Of course only specbound values will be saved within each thread's
> state, but each thread must maintain a pointer to the field that is
> actually holding the value of the forwarded variables.
>
>> Indeed, a simple #define will not be enough then, but we would not waste
>> memory copying the values that will never be changed anyway.
>
> On my machine, struct emacs_globals is 7490 bytes, just short of 7 KiB.
Correction: just over 7 KiB.
- Re: Emacs design and architecture. How about copy-on-write?, (continued)
- 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?, Emanuel Berg, 2023/09/19
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/20
- 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?, Ihor Radchenko, 2023/09/20
- 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?, Ihor Radchenko, 2023/09/20
- 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?, Ihor Radchenko, 2023/09/20
- Re: Emacs design and architecture. How about copy-on-write?,
Po Lu <=
- 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?, Po Lu, 2023/09/20
- 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?, Eli Zaretskii, 2023/09/21
- 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?, Eli Zaretskii, 2023/09/21
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/21
- Re: Emacs design and architecture. How about copy-on-write?, Eli Zaretskii, 2023/09/21
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/21
- Re: Emacs design and architecture. How about copy-on-write?, Po Lu, 2023/09/21