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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 24 Mar 2020 16:40:07 +0200

> Date: Tue, 24 Mar 2020 12:22:57 +0800
> From: HaiJun Zhang <[email-masked]>
> Cc: [email-masked], [email-masked], [email-masked]
> 
>  Suppose a module thread will be able to parse JSON: what would the
>  main (a.k.a. "Lisp") thread of Emacs do while the module thread is
>  working? Doesn’t it need to wait for the parsed data anyhow?
> 
> They don’t known each other.

I'm not sure I understand the response.  Let me repeat the question:
while the module thread parses JSON, will the main thread wait for it,
or will it do something else?  Can you describe how this would work
using some use case where lsp-mode is used, like for completing on
program symbols?

> It will be good if module thread can post message to lisp thread. It will be
> better if module thread can send lisp data within the message to lisp thread. 

Posting messages is possible by writing to a pipe.  But I don't think
I understand what you mean by "send Lisp data" -- how (in what form)
can Lisp data be sent?

>  I don't think I understand what does pdumper have to do with this
>  issue. 
> 
> My understanding is that pdumper can serialize and deserialize lisp data. Maybe we can prepare data with its
> format and let it deserialize them.

But we already do that: the libjansson library "serializes" the data,
and we then deserialize it in Emacs as we get the data from the
library.  That deserialization is what takes the time you are trying
to make shorter.