From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: [RFC] Adding threads to Eshell
Date: Fri, 16 Dec 2022 12:25:57 -0800 [thread overview]
Message-ID: <470f5b87-85b7-4132-48b7-0b36ed821522@gmail.com> (raw)
In-Reply-To: <83mt7ni0ub.fsf@gnu.org>
On 12/16/2022 11:51 AM, Eli Zaretskii wrote:
>> Date: Thu, 15 Dec 2022 18:37:09 -0800
>> From: Jim Porter <jporterbugs@gmail.com>
>>
>> However, before I go too far, I wanted to check with other, more
>> knowledgeable people: are Emacs threads available on all platforms?
>
> Yes. The only known exception is MSDOS.
Ok, so it looks like MSDOS is also the only platform that lacks support
for async subprocesses. In that case, I think it would be ok to require
threads for Eshell if you want to execute commands asynchronously.
>> It looks like it requires the pthreads library
>
> pthreads are required only on Posix platforms; on Windows we use
> Windows-specific APIs instead. See systhread.c.
Ah ha. I had somehow gotten it into my head that Emacs used pthread
wrappers on Win32.
> No, they are real threads. You can see them with any OS-level tool
> that can examine threads. We just let only a single one of these
> threads to run at any given time (well, with the exception of very
> short time windows).
Oh, ok. I don't think that will make anything harder to implement
though, so no worries there.
>> I might be able to avoid this issue, but it would be nice to be able
>> to let-bind some defvars and then pass those bindings to an Eshell
>> command to do its thing.
>
> If that is what you want, you will have to pass those bindings as
> arguments to the thread function.
Like I said in my message to Stefan, I'm not totally sure if this is the
right way to go, but I want to experiment with it a bit more. It doesn't
look too hard to pass those bindings in once I have them, but I don't
know of a good way to get the list of all local bindings of dynamic
variables in the first place.
prev parent reply other threads:[~2022-12-16 20:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 2:37 [RFC] Adding threads to Eshell Jim Porter
2022-12-16 14:05 ` Stefan Monnier
2022-12-16 20:11 ` Jim Porter
2022-12-17 3:40 ` Stefan Monnier
2022-12-17 5:19 ` Jim Porter
2022-12-16 19:51 ` Eli Zaretskii
2022-12-16 20:25 ` Jim Porter [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=470f5b87-85b7-4132-48b7-0b36ed821522@gmail.com \
--to=jporterbugs@gmail.com \
--cc=eliz@gnu.org \
--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.