From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: emacs-devel@gnu.org
Subject: Re: Example of threads and concurrency?
Date: Sun, 19 Feb 2017 11:50:04 -0800 [thread overview]
Message-ID: <87d1eedkpf.fsf@ericabrahamsen.net> (raw)
In-Reply-To: 83o9xyp3ri.fsf@gnu.org
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> 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.
Okay, that makes sense.
Thanks again!
Eric
prev parent reply other threads:[~2017-02-19 19:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-10 19:44 Example of threads and concurrency? Eric Abrahamsen
2017-02-18 18:43 ` Eric Abrahamsen
2017-02-18 19:23 ` Noam Postavsky
2017-02-18 19:41 ` Eli Zaretskii
2017-02-18 19:43 ` Noam Postavsky
2017-02-18 19:27 ` Eli Zaretskii
2017-02-18 20:40 ` Eric Abrahamsen
2017-02-19 16:02 ` Eli Zaretskii
2017-02-19 19:50 ` Eric Abrahamsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1eedkpf.fsf@ericabrahamsen.net \
--to=eric@ericabrahamsen.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.