delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/15/03:54:19

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=LrezJaIaRfEXdVJnX748bfqhMVzPKd2DmYot377TXQRBVaImoEF8j
MhCSwq1dcp5PFTuzxX4nw80nitUOx49BGl6aVgiGvoivsX54L0QbgWCtzWZy6YX/
QQEvhidBxGu9XSa9csDZTIyhS/nThiDwoaM8ipiIUaayEBVRRxOdvk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=JP5M47ZeQ9P2giekccLJrNIlM7I=; b=YPJEJFXEHqGj6TpXT4ot3EvCC0BC
7ytNmHNjYESB0tNyG0hG181bKTzprAzHaRZLI5/Z5CYOpSxhEYSWwQj9WLL+MUIf
dB7GIkLrQWA00GTQ7cZAsSsrCTYKJz2q+4qZo57nnI88zDtBFdJhey969Sc/EBzh
Ch/0/ZZfFr2mTJ8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-104.8 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=outline, H*F:D*cygwin.com, interest
X-HELO: mout.kundenserver.de
Date: Mon, 15 Jul 2019 09:53:27 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: sigpending() incorrectly returns signals pending on other threads
Message-ID: <20190715075327.GL3772@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAJouXQne09R+j+k+ZNw5fsZTFqDG5_9iwm9KQnxHoycL+ap_KQ AT mail DOT gmail DOT com> <CAJouXQksOsqWV=pVAJrXPn2FKtAyUO3QTxpugJ9R9rLGEN91UQ AT mail DOT gmail DOT com> <20190712153351 DOT GH3772 AT calimero DOT vinschen DOT de> <2f15106bf3becd524ac77e7bf0209d31 AT smtp-cloud9 DOT xs4all DOT net>
MIME-Version: 1.0
In-Reply-To: <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net>
User-Agent: Mutt/1.11.3 (2019-02-01)

--adJ1OR3c6QgCpb/j
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Jul 14 15:19, Houder wrote:
> On Fri, 12 Jul 2019 17:33:51, Corinna Vinschen  wrote:
>=20
> > On Jul  6 19:15, Kenton Varda wrote:
>=20
> > > I found a second problem which may or may not be related:
>=20
> > > 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.
> >=20
> > 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.
>=20
> .. uhm, just a note in the interest of accuracy ...
>=20
>  - standard signals (which include USRSIG1 and USRSIG2) are not queued
>    (traditional signal semantics)
>  - only real-time signals should be queued ...
>=20
> 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.
>=20
> Source: 33.2.1 (How the Unix Signal Model maps to threads) of LPI.
>=20
> 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

--=20
Corinna Vinschen
Cygwin Maintainer

--adJ1OR3c6QgCpb/j
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl0sMPcACgkQ9TYGna5E
T6Axhw//aXViLkgQDBcMrb4G+f6ZAkizAMPonLeo+M2uLm6xUJp4CJF7CT3F4Lkj
oGroiZqEe28pRIFSbaaJiIXhcp07pZcqcAQzXQohFjRmhWQpTijP1r770WODFiYr
acvXsr1LcpargEXP0vxLwMxunwXLYt4EY3jVYUzTKu+WmDCbZJg7subEgnm+1TJv
7hkYR1AKI74pdIvPdsOSiM1QQ7UKU3cVTCXwEdZT5lEGjeTYOgBiM3ixktMS7hJN
e4V1BSf/zgYNBy2xcS59VWlbULBehWcEWvlVbLMFTygQmp7bNcJ7aFh0RT9AKpHP
EP1vYSr2fOaFmfSjyxAxsAhFdSLcyrdYviw/RJqNaI8zX063Jjwwhf1qabWbMg6R
25scvGHJn4Hx/R2cNUK5HqrmGC0LijxMH206mWLITReoHwygPC8eBQBb1R+/6LS2
KpXXyA0jC1PymWMTyDSpMI3BkywUJnylZR0R6A+PqUuvM8VrDoduFTcGs7OEAIQ6
dtmzWEZA8eptApQPTyE96yksj49MOKoVfTK+/AyMKcHRMqpAXTWORkjjbBlZ0W4d
ZVXYS46lvacTNN6bdCiyDmBEeMu76jgHAbX+2EB42JS6MV137OFy7fEvpg+ysNDn
cUxL/jrL+HgZqaE4w6wR4t4CUrpGMOGdY1rXTHM7HXaL1EMkpsc=
=TD3A
-----END PGP SIGNATURE-----

--adJ1OR3c6QgCpb/j--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019