[Top][All Lists]

[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: Mon, 17 Jul 2023 09:54:31 +0000

Po Lu <luangruo@yahoo.com> writes:

>> And I am not sure how things will affect memory alignment of symbol
>> objects (I do not fully understand the relevant comments in lisp.h)
> How is any of this relevant to symbol alignment?  Please tell us which
> comments you're referring to.


>> we should be careful about concurrent read access to struct slots in
>> shared objects.
> Fortunately, there are very few direct references to fields within
> Lisp_Symbol.

What I mean is a situation when we try to read sym->u.s.val.value, but
the value becomes Lisp_Object value[].

Then, realloc calls in other thread may create a race condition when
accessing array element may point to obsolete memory address that was
only valid prior to realloc.

Of course, it is just a trivial example. I am worried about less obvious
scenarios (those, I can't predict in advance).

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]