From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Alan Mackenzie <acm@muc.de>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls
Date: Thu, 23 Nov 2017 13:46:44 -0500 [thread overview]
Message-ID: <jwvbmjskf99.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20171123181017.GA5167@ACM> (Alan Mackenzie's message of "Thu, 23 Nov 2017 18:10:17 +0000")
>> Hmm... that might work, but I still can't imagine what comment I could
>> write next to the code to explain/prove that it's safe.
> It's as safe as the original, since the only buffer space used is the
> original raw_keybuf, indexed by raw_keybuf_count. The only change is to
> initialise raw_keybuf_count in different places, to allow the recursive
> call to read_key_sequence not to overwrite the current buffer contents.
I had misunderstood. Yes, that does look safe. No idea if it's correct
enough in practice, but it looks much better than what we have.
Thanks.
>> Yet, with the new concurrency feature, the unwind might reset the
>> global var to a pointer into a stack area on another thread, which may
>> have gotten stale in the mean time.
> If we've got two tasks simultaneously accessing that global buffer,
> we're in deep trouble anyway. Obviously some sort of lock would need to
> be applied to this and other global things.
I think in this case eliminating this-single-command-raw-keys is
a better solution, since we can then eliminate the global var.
Stefan
next prev parent reply other threads:[~2017-11-23 18:46 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20171120181209.23553.97060@vcs0.savannah.gnu.org>
[not found] ` <20171120181210.7946F20416@vcs0.savannah.gnu.org>
2017-11-20 18:41 ` [Emacs-diffs] master 5b5f441: read_key_sequence: correct the handling of raw_keybuf in recursive calls Stefan Monnier
2017-11-20 19:59 ` Alan Mackenzie
2017-11-20 20:09 ` Stefan Monnier
2017-11-20 20:30 ` Alan Mackenzie
2017-11-20 21:43 ` Stefan Monnier
2017-11-22 19:25 ` Alan Mackenzie
2017-11-22 20:29 ` Stefan Monnier
2017-11-22 21:04 ` Alan Mackenzie
2017-11-23 14:35 ` Stefan Monnier
2017-11-23 18:10 ` Alan Mackenzie
2017-11-23 18:46 ` Stefan Monnier [this message]
2017-11-28 18:03 ` Alan Mackenzie
2017-11-28 20:30 ` Eli Zaretskii
2017-12-01 16:48 ` Alan Mackenzie
2017-12-01 18:17 ` Eli Zaretskii
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=jwvbmjskf99.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=acm@muc.de \
--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.