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: Eli Zaretskii
Subject: Re: Concurrency via isolated process/thread
Date: Thu, 06 Jul 2023 18:10:47 +0300

> From: Ihor Radchenko <yantar92@posteo.net>
> Cc: luangruo@yahoo.com, emacs-devel@gnu.org
> Date: Thu, 06 Jul 2023 14:47:13 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> My understanding is
> >> 
> >>   CHECK_STRING (XCAR (foo));
> >>   <we do not want XCAR (foo) to be altered here>
> >>   foo = XSTRING (XCAR (foo));
> >> 
> >> So, locking is needed to ensure that CHECK_STRING assertion remains valid.
> >> 
> >> Or did you refer to something else?
> >
> > I don't know what Po Lu had in mind, but one aspect of this is that a
> > string object might keep its memory address, but its data could be
> > relocated.  This can happen as part of GC, and is the reason why
> > string data is kept separate from the string itself.
> 
> This does not change my understanding.
> Locking should prevent manipulations with object data over the time span
> the code expects the object to be unchanged.

That could defeat GC, should Emacs decide to run it while the lock is
in place.



reply via email to

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