emacs-devel
[Top][All Lists]
Advanced

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

Re: Multithread or multiprocess in emacs??


From: Philip Kaludercic
Subject: Re: Multithread or multiprocess in emacs??
Date: Mon, 17 Apr 2023 13:37:41 +0000

Ergus <spacibba@aol.com> writes:

> Hi:
>
> Very recently I have seen a code in an elpa package that starts async
> subprocesses; but instead of using make-process the package uses
> make-thread + process-file. This was to reduce the latency and some
> lagging (not evident in my system, but apparently it annoyed the
> package's author).
>
> So, my question is now: Has anyone measured the overhead created by
> make-process in critical parts of the code like flymake checkers, or
> ispell? and compared with creating new threads?
>
> If this is somehow significant maybe we may consider adding a helper
> thread or thread-pool for some purposes as now the C11 standard has the
> threads.h header.

Note that C11 threads are controversial[0], but also optional.  Also, I
might be mistaken, but shouldn't Pthreads in some form be available on
platforms that Emacs runs on?  Also, see (elisp) C Dialect.

There was an article[1] on the topic last year, which might be helpful.

[0] 
https://gustedt.wordpress.com/2012/10/14/c11-defects-c-threads-are-not-realizable-with-posix-threads/
[1] https://coredumped.dev/2022/05/19/a-vision-of-a-multi-threaded-emacs/.

> Is there any work already in this direction? How does Elisp handles
> multithreading?
>
> Best,
> Ergus



reply via email to

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