From: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, emacs-devel@gnu.org
Subject: Re: why "in_sighandler"?
Date: Tue, 22 Aug 2006 10:23:40 +0200 [thread overview]
Message-ID: <44EABF0C.7000207@swipnet.se> (raw)
In-Reply-To: <wlmz9xw75i.wl%mituharu@math.s.chiba-u.ac.jp>
YAMAMOTO Mitsuharu skrev:
>>>>>> On Tue, 22 Aug 2006 08:38:54 +0200, Jan Djärv <jan.h.d@swipnet.se> said:
>
>> How can it be otherwise? If you only have one program counter, that
>> program counter must be changed to the signal handler no matter how
>> many threads you have, i.e. any previous execution (regardless of
>> thread) is interrupted.
>
> Not-running threads have already been *interrupted* by context
> switching. Are they interrupted by a signal again?
What exactly do you mean by interrupted? In the sense that they don't get to
execute, yes they are interrupted. When a signal handler is running, no
threads can run (on a single CPU machine), hence they are all interrupted.
> I don't understand why non-signalled threads are relevant as long as a
> signal handler only executes thread-safe functions. The problem of
> async-signal-unsafe function is that a thread that took a lock in the
> normal context may try to take the same lock in a signal handler
> context. The thread cannot go back to the normal context where the
> lock will be released afterwards, but just waits for the lock in the
> signal handler. As a result, the thread gets stuck. That's
> irrelevant to the other threads.
That can't be it. The mutex is recursive, so a thread is able to take it
multiple times.
Jan D.
next prev parent reply other threads:[~2006-08-22 8:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-20 6:51 why "in_sighandler"? Stefan Monnier
2006-08-20 16:37 ` Jan D.
2006-08-20 18:22 ` Stefan Monnier
2006-08-21 0:08 ` YAMAMOTO Mitsuharu
2006-08-21 6:18 ` Jan Djärv
2006-08-21 6:44 ` YAMAMOTO Mitsuharu
2006-08-21 7:19 ` Jan Djärv
2006-08-21 8:13 ` YAMAMOTO Mitsuharu
2006-08-21 8:46 ` Jan Djärv
2006-08-21 8:58 ` YAMAMOTO Mitsuharu
2006-08-21 11:32 ` Jan Djärv
2006-08-22 0:22 ` YAMAMOTO Mitsuharu
2006-08-22 6:38 ` Jan Djärv
2006-08-22 7:39 ` YAMAMOTO Mitsuharu
2006-08-22 8:23 ` Jan Djärv [this message]
2006-08-22 8:34 ` YAMAMOTO Mitsuharu
2006-08-22 18:00 ` Jan Djärv
2006-08-22 9:43 ` Andreas Schwab
2006-08-21 11:13 ` Richard Stallman
2006-08-21 12:55 ` Jan Djärv
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=44EABF0C.7000207@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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.