public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Is async-signal-safety applicable to Cygwin?
@ 2019-03-19 14:28 LRN
  2019-03-19 14:35 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: LRN @ 2019-03-19 14:28 UTC (permalink / raw)
  To: All


[-- Attachment #1.1: Type: text/plain, Size: 416 bytes --]

ASS[0] is documented for Linux (and for POSIX) but i'm failing to find any
information on how this applies to Cygwin. I assume, since there are no "real"
signals on Cygwin, that it's not possible for a signal handler to break the
state of some function that happened to be executed when the signal handler was
triggered. But i could be wrong.

[0]: http://man7.org/linux/man-pages/man7/signal-safety.7.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Is async-signal-safety applicable to Cygwin?
  2019-03-19 14:28 Is async-signal-safety applicable to Cygwin? LRN
@ 2019-03-19 14:35 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2019-03-19 14:35 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1228 bytes --]

On 3/19/19 9:28 AM, LRN wrote:
> ASS[0] is documented for Linux (and for POSIX) but i'm failing to find any
> information on how this applies to Cygwin. I assume, since there are no "real"
> signals on Cygwin, that it's not possible for a signal handler to break the
> state of some function that happened to be executed when the signal handler was
> triggered. But i could be wrong.

You are wrong. It IS applicable. Cygwin has signals and signal handlers;
although Windows may not have POSIX signals as such, it DOES have the
ability to interrupt a process mid-function when a timer expires, and
cygwin's implementation of signals on top of the semantics that windows
provides can indeed result in interrupting the middle of a
non-async-safe function.  Hence, a signal handler that calls a
non-async-safe function at the same time that the signal has interrupted
another non-async-safe function is indeed observable on Cygwin and can
indeed result in deadlocks (a classic example being the case if you
malloc() from a signal handler that interrupted an ongoing malloc() call).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-19 14:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 14:28 Is async-signal-safety applicable to Cygwin? LRN
2019-03-19 14:35 ` Eric Blake

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).