From: Eli Zaretskii <eliz@gnu.org>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: emacs-devel@gnu.org
Subject: Re: Kludge in eval.c
Date: Mon, 12 Dec 2016 19:40:34 +0200 [thread overview]
Message-ID: <8360mpcagd.fsf@gnu.org> (raw)
In-Reply-To: <CAM-tV-94TbJxfh+-U3O+-8f34eJkrRNqVqroy+OcDEgFNr1OnQ@mail.gmail.com> (message from Noam Postavsky on Sun, 11 Dec 2016 13:36:25 -0500)
> From: Noam Postavsky <npostavs@users.sourceforge.net>
> Date: Sun, 11 Dec 2016 13:36:25 -0500
>
> > When I worked on merging the concurrency branch, I bumped into a
> > problem with the recently introduced watcher feature. The problem is
> > that variables can have thread-local bindings, so when there's a
> > thread switch, Emacs needs to rebind those variables to the values
> > they have in the new thread. If such a variable is marked as
> > trap-write, rebinding would normally call the watchers, which I think
> > is not what we want. Do you agree?
>
> Yes, I agree. The fact that thread-local values are implemented by
> rebinding is a C level implementation detail that shouldn't leak into
> Lisp code.
>
> >
> > If you agree, then we need a way of bypassing the watchers call when
> > the rebinding is due to a thread switch. In the merged concurrency
> > code I used a semi-kludgey solution for that, see the two FIXMEs I
> > left behind, in rebind_for_thread_switch and unbind_for_thread_switch.
> > Could you please look at that and suggest a cleaner solution?
> >
>
> The easiest is adding a global flag, but after doing that, I realized
> adding a parameter to set_internal and friends isn't too much trouble.
> So my suggestion is the attached v2 patch, I've included the v1 for
> comparison, since I had written it already anyway.
Thanks, please push your v2.
next prev parent reply other threads:[~2016-12-12 17:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8337hvfs7j.fsf@gnu.org>
2016-12-11 18:36 ` Kludge in eval.c Noam Postavsky
2016-12-12 17:40 ` Eli Zaretskii [this message]
2016-12-13 2:46 ` Noam Postavsky
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=8360mpcagd.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=npostavs@users.sourceforge.net \
/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.