emacs-devel
[Top][All Lists]
Advanced

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

Re: Example of threads and concurrency?


From: Eli Zaretskii
Subject: Re: Example of threads and concurrency?
Date: Sun, 19 Feb 2017 18:02:57 +0200

> From: Eric Abrahamsen <address@hidden>
> Date: Sat, 18 Feb 2017 12:40:54 -0800
> 
> In my dumb example I had indeed expected to use accept-process-output.
> But there's not a whole lot of advantage of using threads plus
> accept-process-output over just using start|make-process with sentinels
> and callbacks, right?

It depends on what your network- or process-related code needs to do.
If it just reads whatever the process has to give and that's all, then
indeed, these two methods are roughly equivalent.  But if it has some
more complex processing, like waiting for the process, dealing with
errors, interacting with it, etc., then running that in a separate
thread can make your code much simpler and easier to write, while
letting the main thread (and thus the user) go about its business.



reply via email to

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