[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: Mon, 17 Jul 2023 16:36:35 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Ihor Radchenko <yantar92@posteo.net> writes:

> I can see several ways to approach this:
> 1. We can maintain a separate, sparse (just for changed variables)
>    obarray inside threads, so that `intern'
>    will point to thread-local symbol objects.

Interning happens at read (and thus load) time.  Byte-code vectors and
lambdas given to make-thread contain symbols, and not their names.  A
thread-local obarray will not be helpful.

> 2. Force lexical scope inside threads, so that the values do not have to
>    be stored in object value slots, but within per-thread lexical scope
>    structure.
>    This however, will not work when using things like `cl-letf' where
>    Elisp code may want to temporarily set symbol function slots.

This is not realistic.

> 3. Store multiple value and function slots in symbol objects.

Why would this be difficult?  It would slow down accesses to value and
function slots (especially those which aren't bound dynamically), but
that's an unavoidable drawback of multiprocessing.

reply via email to

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