GNU bug report logs -
#38807
[Feature request]: Support lisp workers like web workers.
Previous Next
Reported by: HaiJun Zhang <netjune <at> outlook.com>
Date: Mon, 30 Dec 2019 05:29:02 UTC
Severity: wishlist
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #68 received at 38807 <at> debbugs.gnu.org (full text, mbox):
> Date: Wed, 1 Jan 2020 10:59:31 +0800
> From: HaiJun Zhang <netjune <at> outlook.com>
> Cc: michael.albinus <at> gmx.de, 38807 <at> debbugs.gnu.org
>
> Your idea in fact means to have several isolated Lisp machines in the
> same process. But how can we do something like that without a very
> radical redesign of Emacs, when so many things in Emacs are implicitly
> part of the global state? Buffers, global variables, windows,
> frames--all those are global resources, and every thread will want to
> access them. Emacs was not designed to allow that.
>
> All those global resources are not accessible by workers. Workers can only access network, file system and
> other non-global resources. They only do the following things:
> 1. retrieve content from network, parse the data, and send the result(lisp data) to the UI thread to present it
> 2. communicate with subprocesses, parse the data from subprocesses, and send the result to the UI thread
> 3. do file indexing and send the index result to the UI thread
> 4. do other heavy work like mathematicl calculation and deep learning, send the result to the UI thread
Then these threads cannot really run Lisp at all, nor even directly
affect Lisp data. So in effect you want to be able to run threads
that don't enter the Lisp interpreter, nor modify any Lisp data. We
already have that available: you can write a module which Emacs can
load, and that module can then start any number of threads doing any
calculations or network communications you want. See emacs-module.h.
> The disadvantage is that it is cumbersome to share data between the
> two instances of Emacs, and large amounts of data will make that
> inefficient.
>
> We may design an IPC for their communication.
For some data structures, yes. But buffer text and long strings are
problematic, because the text can be very large.
This bug report was last modified 3 years and 63 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.