all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Michał Krzywkowski" <mkrzywkow@gmail.com>
Cc: 37892@debbugs.gnu.org
Subject: bug#37892: 27.0.50; Crash when signaling a thread
Date: Sun, 27 Oct 2019 15:25:50 +0200	[thread overview]
Message-ID: <83r22ys4kh.fsf@gnu.org> (raw)
In-Reply-To: <878sp6wl24.fsf@gmail.com> (message from Michał Krzywkowski on Sun, 27 Oct 2019 11:16:03 +0100)

> From: Michał Krzywkowski <mkrzywkow@gmail.com>
> Cc: Michał Krzywkowski <mkrzywkow@gmail.com>,
>  37892@debbugs.gnu.org
> Date: Sun, 27 Oct 2019 11:16:03 +0100
> 
>     >> I actually don't care (and can't know) what another thread is doing, I
>     >> just want to send a signal to it.
> 
>     Eli> But thread-signal is not for causing an error in a thread, it is for
>     Eli> unblocking a thread that waits on a mutex or a condvar.  So why would
>     Eli> you use it when the thread is not blocked?
> 
> Then I think documentation for that function should be changed to
> explicitly say that the signal will *only* be delivered if the target
> thread is in a "blocked call to ‘mutex-lock’, ‘condition-wait’, or
> ‘thread-join’".
> 
> Currently, the docstring of thread-signal just says that the function
> will interrupt threads which are blocked, but does not actually say that
> the signal will be delivered only in those cases.  In fact, it says that
> it works like signal, so I don't think it's unreasonable to assume that
> it will just interrupt a thread whatever it's doing.

The function does work like a signal, but Emacs cannot be interrupted
while it waits for input.  In all other cases your signal will be
delivered, and if unhandled, it will terminate the thread.

If we decide that thread-signal will have no effect while a thread
waits for input, then we will document that, of course.  My question
was meant to understand your intent for signaling a thread at
arbitrary time, because the effect of that is unpredictable, even if
the crash didn't happen.  I wanted to understand your thinking and
rationale, so as to have a better basis for the decision of how to fix
this problem.

So could you please elaborate on your rationale?

Thanks.





  reply	other threads:[~2019-10-27 13:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 17:06 bug#37892: 27.0.50; Crash when signaling a thread Michał Krzywkowski
2019-10-25  8:44 ` Eli Zaretskii
2019-10-26 12:29   ` Michał Krzywkowski
2019-10-26 12:58     ` Eli Zaretskii
2019-10-27 10:16       ` Michał Krzywkowski
2019-10-27 13:25         ` Eli Zaretskii [this message]
2019-10-27 19:26           ` Michał Krzywkowski
2021-12-05  3:15 ` Lars Ingebrigtsen

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=83r22ys4kh.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=37892@debbugs.gnu.org \
    --cc=mkrzywkow@gmail.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.