[Top][All Lists]

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

Concurrency via isolated process/thread

From: Ihor Radchenko
Subject: Concurrency via isolated process/thread
Date: Tue, 04 Jul 2023 16:58:49 +0000

[ Discussion moved from
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=64423 ]

> > I feel that I am repeating an already proposed idea, but what about
> > concurrent isolated process that interacts with the main process?
> (This stuff should not be discussed on the bug tracker, but on
> emacs-devel.)

> If you mean what the async package does, then yes, this is a workable
> idea.  But it doesn't need to change anything in Emacs, and it has
> some downsides, like the difficulties in sharing state with the other
> process.

I had something similar in mind, but slightly different.

emacs-async package explicitly transfers pre-defined set of variables to
the async Emacs process and cannot transfer non-printable variables
(like markers or buffers).

But may it be possible to

1. Limit the async process memory to a small lexical subset of symbols
   (within a function).

2. Every time the async process needs to read/write a symbol slot
   outside its lexical scope, query the main Emacs process.

More concretely, is it possible to copy internal Elisp object
representations between Emacs processes and arrange mutability to query
the right Emacs process that "owns" the object?

The inter-process communication does not have to be asynchronous, but
may work similar to the existing thread implementation.

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]