Subject: Re: bug#38807: [Feature request]: Support lisp workers like web workers.

From: Eli Zaretskii <[email-masked]>
Date: Sat, 21 Mar 2020 10:16:28 +0200

> Date: Sat, 21 Mar 2020 10:24:37 +0800
> From: HaiJun Zhang <[email-masked]>
> Cc: [email-masked], [email-masked]
> 
> I known module code can call emacs functions. But is it true for threads in module?

Since the Lisp interpreter is non-reentrant, this is not possible.

> See this: https://github.com/emacs-lsp/lsp-mode/issues/676#issuecomment-476700911
> 
> That means if a native-code thread is to be run in parallel with the UI thread, it can never access an Env. 

Yes, but so what?  You can still do work in the module threads, then
send the accumulated results to emacs from the main thread.

Again, this is all too abstract.  A useful discussion would have many
more details regarding the job that needs to be done and the
bottle-necks that need to be distributed to threads running in
parallel.