From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: phst@google.com, emacs-devel@gnu.org
Subject: Re: [PATCH] Support threads in modules
Date: Sat, 22 Apr 2017 20:05:19 +0000 [thread overview]
Message-ID: <CAArVCkRYxvPw_GUdpgdkW4W38=dRXv-BRsdGyw=jr17yOQV4rw@mail.gmail.com> (raw)
In-Reply-To: <83tw5gp6hy.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
Eli Zaretskii <eliz@gnu.org> schrieb am Sa., 22. Apr. 2017 um 21:49 Uhr:
> > From: Philipp Stephani <p.stephani2@gmail.com>
> > Date: Sat, 22 Apr 2017 19:21:35 +0000
> > Cc: emacs-devel@gnu.org, phst@google.com
> >
> > Can you explain the purpose of these changes and the motivation? A
> > module shouldn't be restricted to be used by a single thread, should
> > it?
> >
> > No, but the thread used to create an environment object, the current
> Emacs thread, and the current OS thread
> > all have to match. Right now this isn't checked; the current code checks
> only for the main thread, which isn't
> > correct any more now that there can be more than one interpreter thread.
>
> I agree that checking for the main thread is not TRT, but why not
> allow any thread of those in all_threads? Why do we care that the env
> pointer was created by the same thread as the one using it? We should
> only care that the invoking thread is one of the Emacs application
> threads, no?
>
- Using objects across threads requires careful synchronization. It's not
impossible, but a large burden on module authors.
- The more restrictive the module API is, the more freedom we have in the
implementation.
- The current check is easy to implement and understand. A check for
multiple threads would require another hash table with thread IDs etc.
- The Emacs module API is modelled after JNI, which has the same
restriction (
http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/design.html).
We should stick to the JNI semantics wherever possible, because JNI is a
well-tested and robust technology.
[-- Attachment #2: Type: text/html, Size: 2261 bytes --]
next prev parent reply other threads:[~2017-04-22 20:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-22 15:24 [PATCH] Support threads in modules Philipp Stephani
2017-04-22 19:09 ` Eli Zaretskii
2017-04-22 19:21 ` Philipp Stephani
2017-04-22 19:49 ` Eli Zaretskii
2017-04-22 20:05 ` Philipp Stephani [this message]
2017-04-22 20:14 ` Eli Zaretskii
2017-04-23 6:14 ` John Wiegley
2017-04-23 12:40 ` Stefan Monnier
2017-04-26 5:23 ` Eli Zaretskii
2017-04-23 15:54 ` Philipp Stephani
2017-04-23 15:52 ` Philipp Stephani
2017-04-26 5:31 ` Eli Zaretskii
2017-06-10 11:38 ` Philipp Stephani
2017-06-10 12:38 ` Eli Zaretskii
2017-06-10 19:58 ` Philipp Stephani
2017-06-11 13:25 ` Philipp Stephani
2017-06-11 14:54 ` Eli Zaretskii
2017-06-11 17:12 ` Philipp Stephani
2017-06-11 15:01 ` Eli Zaretskii
2017-06-12 15:04 ` Philipp Stephani
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='CAArVCkRYxvPw_GUdpgdkW4W38=dRXv-BRsdGyw=jr17yOQV4rw@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=phst@google.com \
/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.