[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs design and architecture. How about copy-on-write?
From: |
Emanuel Berg |
Subject: |
Re: Emacs design and architecture. How about copy-on-write? |
Date: |
Fri, 22 Sep 2023 16:22:10 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Eli Zaretskii wrote:
>>> If we need to lock 99.99% of Emacs "single" variables, it
>>> is easier to lock everything. Faster, too.
>>
>> Why do we need to do that?
>>
>> For one thread, one write operation, and one variable, only
>> that variable has to be locked?
>>
>> (operate-on var1) ; here we need a lock on var1
>> (operate-on var2) ; etc
>
> We don't have 'operate' in Emacs, but we do have setq, setf,
> and others. Where do you locak and where do you unlock in
> that case?
>
> Just try to write a simplest Lisp program, and you will see
> the problem.
There is no way around it, in order to prevent a race
condition any global variable must be locked before it's value
can be altered.
So `setq', `setf' and any other setter of global variables
must first be refered to the locking mechanism where they
either acquire the lock, perform the write, and release the
lock; or, if the variable is already locked by some other
thread wanting to do the same thing, they must be queued so
they will get it in due time.
--
underground experts united
https://dataswamp.org/~incal
- Re: [External] : Re: Emacs design and architecture. How about copy-on-write?, (continued)
- Re: [External] : Re: Emacs design and architecture. How about copy-on-write?, Emanuel Berg, 2023/09/26
- 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, 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?, 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 <=
- 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
- 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/23
- Re: Emacs design and architecture. How about copy-on-write?, Ihor Radchenko, 2023/09/19