Sujet : Re: OT: Windows (Was: Re: Open Source does not mean easily
De : cross (at) *nospam* spitfire.i.gajendra.net (Dan Cross)
Groupes : comp.unix.programmerDate : 07. Jan 2025, 17:02:51
Autres entêtes
Organisation : PANIX Public Access Internet and UNIX, NYC
Message-ID : <vljj7b$g76$1@reader2.panix.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vljg72$28nj0$1@dont-email.me>, <
Muttley@DastardlyHQ.org> wrote:
On Tue, 7 Jan 2025 14:13:29 -0000 (UTC)
cross@spitfire.i.gajendra.net (Dan Cross) wibbled:
In article <vlioum$24bqm$1@dont-email.me>, <Muttley@DastardlyHQ.org> wrote:
On Mon, 6 Jan 2025 16:39:49 -0000 (UTC)
Thats not the same as the program itself being asynch.
>
Isn't it? The point is that the program kicks off multiple
>
Not, it isn't. Using operating system facilities is standard programming, its
not asych programming whereby the program execution will be automatically
be diverted when an operation completes.
>
Thats not proper asych, its still sequential. Proper asynch is when the
program execution path is directly modified by external events. Otherwise
you could claim simply using the standard file I/O system is asynchronous
programming as there's no guarantee that any data has been written to the
disk
before write(), fprintf() etc return.
>
This is conflating multiple things. Most IO operations dealing
with the actual hardware _are_ asynchronous (this is what
McIlroy meant in the quote I posted earlier). The system call
interface gives the program the illusion of those happening
sequentially, but that's not how the devices really work.
>
And? By your definition its still asynchronous programming.
In the kernel, it sure is. Unix programmers have been writing
asynchronous programs (using e.g. `fork`) since 1970.
Sure, but as I've said before, signals should only set flags to be processed
later.
>
You said that, but that flies in the face of 50 years of
evidence to the contrary and the letter of the standard. This
>
Please don't just make stuff up.
Hmm. I wonder what shell you use, if you use Unix at all.
Here for example is the signal handler for SIGINT in bash:
https://git.savannah.gnu.org/cgit/bash.git/tree/sig.c?h=devel#n691You'll notice that it's rather more complex than just "set a
flag or `wait`.
Here's the handler in `zsh`:
https://github.com/zsh-users/zsh/blob/263659acb73d0222e641dfd8d37e48e96582de02/Src/signals.c#L399You'll again notice that it does rather more than just "set a
flag or wait."
Here's the SIGWINCH handler for good 'ol `script` from
OpenBSD:
https://github.com/openbsd/src/blob/6d253f95424ee0054c798f493d12377911cd3668/usr.bin/script/script.c#L224Wow, that one does ioctl's modifying PTY state and signals an
entire process group. That's definitely a bit more than just
"setting a flag or wait."
Here's an example from Postgres:
https://github.com/postgres/postgres/blob/5b291d1c9c09d75982c3270bfa61d4e822087b6a/src/backend/storage/ipc/latch.c#L2269Wow, that one writes to a pipe. Definitely a bit more than just
"setting a flag or wait."
Those are just a few examples. If one cares to look, one will
find many more in non-trivial programs used in production daily.
- Dan C.