From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32010 invoked by alias); 15 Jul 2019 07:53:32 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 32003 invoked by uid 89); 15 Jul 2019 07:53:32 -0000 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 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (212.227.126.187) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 15 Jul 2019 07:53:31 +0000 Received: from calimero.vinschen.de ([24.134.7.25]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N6sSV-1iX1Ud1IeF-018Iwz for ; Mon, 15 Jul 2019 09:53:28 +0200 Received: by calimero.vinschen.de (Postfix, from userid 500) id 8B614A80723; Mon, 15 Jul 2019 09:53:27 +0200 (CEST) Date: Mon, 15 Jul 2019 07:53:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: sigpending() incorrectly returns signals pending on other threads Message-ID: <20190715075327.GL3772@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20190712153351.GH3772@calimero.vinschen.de> <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="adJ1OR3c6QgCpb/j" Content-Disposition: inline In-Reply-To: <2f15106bf3becd524ac77e7bf0209d31@smtp-cloud9.xs4all.net> User-Agent: Mutt/1.11.3 (2019-02-01) X-SW-Source: 2019-07/txt/msg00113.txt.bz2 --adJ1OR3c6QgCpb/j Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1833 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" Content-length: 833 -----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--