From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: sigpending() incorrectly returns signals pending on other threads
Date: Mon, 15 Jul 2019 07:53:00 -0000 [thread overview]
Message-ID: <20190715075327.GL3772@calimero.vinschen.de> (raw)
In-Reply-To: <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net>
[-- Attachment #1: Type: text/plain, Size: 1862 bytes --]
On Jul 14 15:19, Houder wrote:
> On Fri, 12 Jul 2019 17:33:51, Corinna Vinschen wrote:
>
> > On Jul 6 19:15, Kenton Varda wrote:
>
> > > I found a second problem which may or may not be related:
>
> > > If two threads use pthread_kill() to send each other the same signal,
> > > such that the signal should be separately pending on both threads at
> > > the same time, only one of the two signals is actually queued. It
> > > seems that pthread_kill() is ignored if the same signal is already
> > > pending on some other thread.
> >
> > The current signal mechanism in Cygwin only allows for a signal to be
> > queued once. Changing that is a pretty ambitioned task, which I simply
> > don't have enought time for. However, patches to change that are more
> > than welcome.
>
> .. uhm, just a note in the interest of accuracy ...
>
> - standard signals (which include USRSIG1 and USRSIG2) are not queued
> (traditional signal semantics)
> - only real-time signals should be queued ...
>
> The executive (cygwin1.dll) must maintain a record of the signals that
> are pending for the process as a whole,
> as well as a record of the signals that are pending for each thread.
Yeah, the latter is missing so far.
> A call to sigpending() returns the union of the set of signals that are
> pending for the process
> and those that are pending for the calling thread.
>
> Source: 33.2.1 (How the Unix Signal Model maps to threads) of LPI.
>
> Undoubtedly, the signal mechanism in Cygwin must be "adapted", but
> as far as I can tell, there is no requirement to "queue" any of the
> standard signals ...
I think queing here means just what you outline above. It's kind of a
queue of pending signals and in Cygwin it's actually literally a queue.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-07-15 7:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-06 22:46 Kenton Varda
2019-07-07 2:16 ` Kenton Varda
2019-07-12 15:34 ` Corinna Vinschen
2019-07-14 13:19 ` Houder
2019-07-15 7:53 ` Corinna Vinschen [this message]
2019-07-15 9:54 ` Houder
2019-07-12 15:31 ` Corinna Vinschen
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=20190715075327.GL3772@calimero.vinschen.de \
--to=corinna-cygwin@cygwin.com \
--cc=cygwin@cygwin.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).