emacs-devel
[Top][All Lists]
Advanced

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

Re: Is there any easy way to fork in elisp? Why not?


From: Rudi C
Subject: Re: Is there any easy way to fork in elisp? Why not?
Date: Fri, 29 Oct 2021 01:46:59 +0330

I am not an expert, but if adding forks for all platforms is so difficult that it cannot be added in the foreseeable future, please consider just not supporting the fork API on Windows. (Windows can also fallback to WSL, though I haven't tested it. Has anyone benchmarked the WSL version versus native Windows?)

PS: I repeat, the current third-party async packages do NOT offer much of anything; They just start a fresh emacs, without the variables/functions of the parent process.

On Fri, Oct 29, 2021 at 1:36 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> If the server could just fork, eval the request, return it, and die,
> everything would be easy and painless.
>
> The fork API could be:
> ```
> (let-fork ((some_val (expensive_compute)) ...)
>  (lambda()
>    (message "Computed: %s" some_val)))
> ```

We should indeed add such support in core.  Currently the `async`
package offers such functionality, but I think this belongs in core.

More generally a kind of "Emacs batch server" will be useful.
Something similar to the server.el but whose purpose would be to launch
independent/fresh batch Emacs sessions efficiently.

A long time ago I suggested to add support for the `fork`
POSIX primitive which could be ideal for that, but AFAIK it's hard to
provide such a functionality in w32, so we'd want the Lisp-level API not
to be tied to the semantics of POSIX `fork`.


        Stefan


reply via email to

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