[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Concurrency via isolated process/thread

From: Po Lu
Subject: Re: Concurrency via isolated process/thread
Date: Fri, 07 Jul 2023 08:21:27 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> Po Lu <luangruo@yahoo.com> writes:
>>>>>    LOCK_OBJECT (foo);
>>>>>    LOCK_OBJECT (XCAR (foo));
>>>> ...
>>> ...
>>> Do you mean that locking XCAR (foo) is unnecessary when foo is locked?
>> No, that there is no need to lock a cons (or a vector, or anything else
>> with a fixed number of Lisp_Object slots) before reading or writing to
>> it.
> I feel confused here.
> 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.

No, what we want to make sure is that the same string whose type was
checked is extracted.  By not loading XCAR (foo) twice.

reply via email to

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