Deutsch   English   Français   Italiano  
<20250310152000.00004955@yahoo.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: Python recompile
Date: Mon, 10 Mar 2025 15:20:00 +0200
Organization: A noiseless patient Spider
Lines: 63
Message-ID: <20250310152000.00004955@yahoo.com>
References: <vq1qas$j22$1@gallifrey.nk.ca>
	<vq3oag$18iv6$1@dont-email.me>
	<vq4hf2$1brf7$1@dont-email.me>
	<vq4l3d$1ck9e$1@dont-email.me>
	<vq4m0u$1ctpn$1@dont-email.me>
	<vq4n05$1d5dv$1@dont-email.me>
	<vq4om7$1dbo2$2@dont-email.me>
	<vq6dqh$1pskk$1@dont-email.me>
	<vq6f8p$1pmnk$1@dont-email.me>
	<vq6gqc$1qcp8$1@dont-email.me>
	<vq6ips$1pmnk$2@dont-email.me>
	<vq6j5h$1qosf$1@dont-email.me>
	<20250304092827.708@kylheku.com>
	<vq7g1p$1vmg5$1@dont-email.me>
	<vq94dt$2boso$1@dont-email.me>
	<vqcsk7$23bfo$1@paganini.bofh.team>
	<vqefn1$3flpt$1@dont-email.me>
	<vqeu5c$3imil$1@dont-email.me>
	<vqeun4$3iqbq$1@dont-email.me>
	<vqfcbe$3lkkc$1@dont-email.me>
	<871pv861ht.fsf@nosuchdomain.example.com>
	<20250308192940.00001351@yahoo.com>
	<vqi1ge$8jg8$1@dont-email.me>
	<vqibt3$ahu0$3@dont-email.me>
	<vqiibq$bq1o$7@dont-email.me>
	<20250309012626.00001276@yahoo.com>
	<vqiugc$dv5o$2@dont-email.me>
	<20250309112807.0000489d@yahoo.com>
	<vql2bf$uei7$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Date: Mon, 10 Mar 2025 14:20:01 +0100 (CET)
Injection-Info: dont-email.me; posting-host="f3603457c32982ad6e0d0f2ccccd7f15";
	logging-data="1384935"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/S4nCvzyLrf8TvlpdHp6SN5EpxdtFQzuQ="
Cancel-Lock: sha1:CvmOXQSlbbPLodOp3sSnkBJxSIw=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
Bytes: 4475

On Sun, 9 Mar 2025 21:48:31 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

> On Sun, 9 Mar 2025 11:28:07 +0200, Michael S wrote:
>=20
> > select/poll is the one way to do event-driven programming. =20
>=20
> Yes it is.
>=20
> > There are other ways. =20
>=20
> But you just said ...
>=20
> > In particular, under Windows you can simultaneously wait for
> > multiple objects with API that is called... Surprise!
> > WaitForMultipleObjects. =20
>=20
> So, just select/poll under another name, then.

Similar to poll(), yes. Not so similar to super-ugly select(). I hope
that Unix people stopped using select in new programs two or more
decades ago.
But WaitForMultipleObjects can do things that poll can not, like
waiting on semaphore or on event or on thread (for completion, which
POSIX people, in their eternal fondness for idiotic names call 'join').
OTOH, WaitForMultipleObjects can not directly wait on sockets, because
in Win32 socket is not a "kernel object". So, in order to wait on
socket with WFMO one has to associate socket with event, which is done
by means of WSAEventSelect. Yes, the name of the API is bad. UNIX/POSIX
does not have monopoly on stupid names.

> It really is =E2=80=9Cthe one
> way to do event-driven programming=E2=80=9D. Only with the usual Windows
> approach of added clunkiness.
>=20

As mentioned above, it depends on what you want to do. Sometimes UNIX
way is simpler, sometimes it's the other way around.

As to "the one way", you yourself mentioned substantially different way
in your post here several weeks ago - stackless co-routines. Even if
ends up the same under the hood, it appears quite different from
perspective of application programmer. Since we are in c.l.c I
should say that by now this way is not available in C.

Yet another different way is goroutines. They feel like threads but
lighter under the hood. I heard that similar thing was added to latests
Java.  Since we are in c.l.c I should say that by now this way is
also not available in C. And, unlike in case of stackless co-routines,
I don't expect that it would be added to Standard C in foreseeable
future.

> > Yes, it does not work directly with anonymous files. But anonymous
> > file can be treated as a special version of named pipe and then it
> > does work. =20
>=20
> I don=E2=80=99t think that makes sense. Otherwise the problem wouldn=E2=
=80=99t exist.

I don't know where was a catch. As a matter of fact, cygwin people found
solution, so the problem was soluble.