Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Netscape is not a newsreader, and probably never shall be. -- Tom Christiansen


devel / comp.lang.c++ / Re: A Java- / .NET-like monitor

SubjectAuthor
* A Java- / .NET-like monitorBonita Montero
+* Re: A Java- / .NET-like monitorBonita Montero
|`* Re: A Java- / .NET-like monitorChris M. Thomasson
| +* Re: A Java- / .NET-like monitorChris M. Thomasson
| |+* Re: A Java- / .NET-like monitorBonita Montero
| ||`- Re: A Java- / .NET-like monitorChris M. Thomasson
| |`- Re: A Java- / .NET-like monitorChris M. Thomasson
| `* Re: A Java- / .NET-like monitorBonita Montero
|  `- Re: A Java- / .NET-like monitorChris M. Thomasson
+* Re: A Java- / .NET-like monitorKaz Kylheku
|`* Re: A Java- / .NET-like monitorBonita Montero
| `* Re: A Java- / .NET-like monitorKaz Kylheku
|  `* Re: A Java- / .NET-like monitorBonita Montero
|   +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   |`* Re: A Java- / .NET-like monitorKaz Kylheku
|   | `- Re: A Java- / .NET-like monitorChris M. Thomasson
|   +* Re: A Java- / .NET-like monitorKaz Kylheku
|   |`* Re: A Java- / .NET-like monitorBonita Montero
|   | +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |`* Re: A Java- / .NET-like monitorBonita Montero
|   | | `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |+- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |`* Re: A Java- / .NET-like monitorBonita Montero
|   | |   | `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |+- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |`* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   | `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |  +- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |   `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |`* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    | `- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    +* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |`* Re: A Java- / .NET-like monitorPavel
|   | |   |   |    | `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |  `* Re: A Java- / .NET-like monitorPavel
|   | |   |   |    |   `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |    `* Re: A Java- / .NET-like monitorPavel
|   | |   |   |    |     +- Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     +* Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     |+* Re: A Java- / .NET-like monitorKaz Kylheku
|   | |   |   |    |     ||+- Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||+- Re: A Java- / .NET-like monitorPavel
|   | |   |   |    |     ||`* Re: A Java- / .NET-like monitorMichael S
|   | |   |   |    |     || `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||   `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||    +- Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||    `* Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||     `* Re: A Java- / .NET-like monitorKaz Kylheku
|   | |   |   |    |     ||      +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |`* Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||      | +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      | |`- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      | `* Re: A Java- / .NET-like monitorFred. Zwarts
|   | |   |   |    |     ||      |  `* Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||      |   `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    `- Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||      +* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |`* Re: A Java- / .NET-like monitorKaz Kylheku
|   | |   |   |    |     ||      | `* Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||      |  +- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |  `* Re: A Java- / .NET-like monitorMichael S
|   | |   |   |    |     ||      |   +- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |   `* Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      |    +* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    |+* Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      |    ||`* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    || `* Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      |    ||  +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |    ||  |`- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |    ||  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    ||   `* Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      |    ||    `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    ||     `* Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      |    ||      `- Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     ||      |    |`- Re: A Java- / .NET-like monitorScott Lurndal
|   | |   |   |    |     ||      |    `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     ||      |     `- Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     ||      `- Re: A Java- / .NET-like monitorDavid Brown
|   | |   |   |    |     |+- Re: A Java- / .NET-like monitorPavel
|   | |   |   |    |     |`* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     | `* Re: A Java- / .NET-like monitorKaz Kylheku
|   | |   |   |    |     |  `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     |   `* Re: A Java- / .NET-like monitorKaz Kylheku
|   | |   |   |    |     |    `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     |     `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |      +* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |      |`- Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |      `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     |       `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |        `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     |         `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |          `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     |           `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    |     |            `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   |    |     `* Re: A Java- / .NET-like monitorChris M. Thomasson
|   | |   |   |    `* Re: A Java- / .NET-like monitorBonita Montero
|   | |   |   `- Re: A Java- / .NET-like monitorBonita Montero
|   | |   `* Re: A Java- / .NET-like monitorPavel
|   | `* Re: A Java- / .NET-like monitorKaz Kylheku
|   `* Re: A Java- / .NET-like monitorChris M. Thomasson
+* Re: A Java- / .NET-like monitorBonita Montero
`* Re: A Java- / .NET-like monitorBonita Montero

Pages:1234567891011
Re: A Java- / .NET-like monitor

<8PT5N.42131$_Oab.23742@fx15.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2688&group=comp.lang.c%2B%2B#2688

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.hispagatos.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx15.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org> <uiq7o0$1thb$1@raubtier-asyl.eternal-september.org> <Pi84N.104$ayBd.46@fx07.iad> <b9e4N.20671$Ee89.15587@fx17.iad> <20231112204849.10@kylheku.com> <euB4N.6863$%p%e.3900@fx43.iad> <20231113192822.953@kylheku.com> <97V4N.19464$Wzw6.11650@fx13.iad> <uj38lm$1skku$3@dont-email.me> <EAg5N.8455$pgLd.5478@fx05.iad> <20231115223459.609@kylheku.com> <XvA5N.62534$wvv7.58333@fx14.iad> <oxM5N.70257$wvv7.26310@fx14.iad> <20231117103650.654@kylheku.com>
Lines: 14
Message-ID: <8PT5N.42131$_Oab.23742@fx15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 18 Nov 2023 00:45:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 18 Nov 2023 00:45:56 GMT
X-Received-Bytes: 1678
 by: Scott Lurndal - Sat, 18 Nov 2023 00:45 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-11-17, Scott Lurndal <scott@slp53.sl.home> wrote:
>>>https://austin-group-l.opengroup.narkive.com/lKcmfoRI/predictable-scheduling-behavior-in-pthread-cond-broadcast
>>
>> When David wrote that, multiprocessor systems were still rare and
>
>The referenced discussion appears to be from early 2010; maybe
>he was reiterating something from an earlier time?

The Posix 1003.4 (.4b - realtime and .4c - threads) work was in the
mid 90's. At that time, SMP systems were expensive and relatively
rare. My 2p octane workstation in 1998 was great, but uncommon even
in SGI engineering.

Re: A Java- / .NET-like monitor

<88V5N.33567$Ee89.15971@fx17.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2689&group=comp.lang.c%2B%2B#2689

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uigk5o$1nmku$1@raubtier-asyl.eternal-september.org>
<20231108114723.256@kylheku.com>
<uigp4n$1onpc$1@raubtier-asyl.eternal-september.org>
<20231108152102.495@kylheku.com>
<uihnei$21tq7$1@raubtier-asyl.eternal-september.org>
<uihnkd$21rae$1@dont-email.me>
<uihnnm$21tq7$5@raubtier-asyl.eternal-september.org>
<uihnup$21rab$4@dont-email.me>
<uihpgl$227kv$1@raubtier-asyl.eternal-september.org>
<uihpmf$228mv$1@dont-email.me>
<uihq1g$2290l$1@raubtier-asyl.eternal-september.org>
<uihr3u$228mv$11@dont-email.me>
<uihram$22gqs$1@raubtier-asyl.eternal-september.org>
<uihrd6$228mv$13@dont-email.me>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 39
Message-ID: <88V5N.33567$Ee89.15971@fx17.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sat, 18 Nov 2023 02:16:36 UTC
Date: Fri, 17 Nov 2023 21:16:29 -0500
X-Received-Bytes: 3385
 by: Pavel - Sat, 18 Nov 2023 02:16 UTC

Bonita Montero wrote:
> Am 15.11.2023 um 03:10 schrieb Pavel:
>> Bonita Montero wrote:
>>> Am 09.11.2023 um 06:48 schrieb Chris M. Thomasson:
>>>> On 11/8/2023 9:45 PM, Bonita Montero wrote:
>>>>> Am 09.11.2023 um 06:44 schrieb Chris M. Thomasson:
>>>>>
>>>>>> Wait morphing is not in the realm of the compiler. It's in the
>>>>>> kernel.
>>>>>
>>>>> Read this:
>>>>> https://stackoverflow.com/questions/45163701/which-os-platforms-implement-wait-morphing-optimization
>>>>>
>>>>
>>>> Wait morphing can be highly beneficial.
>>>
>>> Wait morphing isn't necessary under Win32 since you can wait
>>> for the mutexe's binary semaphore and for the condvar's counting
>>> semaphore in one step with WaitForMultipleObjects. Unfortunately
>>> there's nothing under Linux like that.
>>>
>> Not true. A Linux program can wait for any number of eventfd
>> semaphores that can be used as either binary or a counting one.
>
> An eventfd can be a semaphore, but only one semaphore and not a set
> like SysV semaphores. You can wait for multiple semaphores with poll
> or select, but a change on one semaphore releases the waiting thread
> whereas with Win32 you can wait for all conditions to be met at once.
>
There is no system call in UNIX to wait for many conditions to be met at
once; but I do not see why it would be useful.

E.g., if there are several vars initialized to 0 and it is required to
wake up a consumer thread when they all are made positive (or >5 or
whatever) by some producer thread or threads, a producer thread that
sets the last variable to the needed value can signal a single condvar
and the consumer thread will wake up to all conditions met at once.

Re: A Java- / .NET-like monitor

<20231117182615.499@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2690&group=comp.lang.c%2B%2B#2690

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 02:30:41 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <20231117182615.499@kylheku.com>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uiq7o0$1thb$1@raubtier-asyl.eternal-september.org>
<Pi84N.104$ayBd.46@fx07.iad> <b9e4N.20671$Ee89.15587@fx17.iad>
<20231112204849.10@kylheku.com> <euB4N.6863$%p%e.3900@fx43.iad>
<20231113192822.953@kylheku.com> <97V4N.19464$Wzw6.11650@fx13.iad>
<uj38lm$1skku$3@dont-email.me> <EAg5N.8455$pgLd.5478@fx05.iad>
<20231115223459.609@kylheku.com> <XvA5N.62534$wvv7.58333@fx14.iad>
<oxM5N.70257$wvv7.26310@fx14.iad> <20231117103650.654@kylheku.com>
<8PT5N.42131$_Oab.23742@fx15.iad>
Injection-Date: Sat, 18 Nov 2023 02:30:41 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e494bd6bf0750eccdbc579c0b4d3dd08";
logging-data="3204150"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19yQXAjdyohr/8NbFy4P4JRrNOXpN3W3JM="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Y+x66paQPzAhJakATuSFpRzYFs0=
 by: Kaz Kylheku - Sat, 18 Nov 2023 02:30 UTC

On 2023-11-18, Scott Lurndal <scott@slp53.sl.home> wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>On 2023-11-17, Scott Lurndal <scott@slp53.sl.home> wrote:
>>>>https://austin-group-l.opengroup.narkive.com/lKcmfoRI/predictable-scheduling-behavior-in-pthread-cond-broadcast
>>>
>>> When David wrote that, multiprocessor systems were still rare and
>>
>>The referenced discussion appears to be from early 2010; maybe
>>he was reiterating something from an earlier time?
>
> The Posix 1003.4 (.4b - realtime and .4c - threads) work was in the
> mid 90's. At that time, SMP systems were expensive and relatively
> rare. My 2p octane workstation in 1998 was great, but uncommon even
> in SGI engineering.

In 1995, I had a PC with a consumer-grade dual Pentium 100 ASUS motherboard,
running Linux 1.3.x, FWIW.

Two parallel gcc compilations were a whopping 30% faster than one!

:)

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: A Java- / .NET-like monitor

<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2692&group=comp.lang.c%2B%2B#2692

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 04:06:23 +0100
Organization: A noiseless patient Spider
Lines: 6
Message-ID: <uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<20231108114723.256@kylheku.com>
<uigp4n$1onpc$1@raubtier-asyl.eternal-september.org>
<20231108152102.495@kylheku.com>
<uihnei$21tq7$1@raubtier-asyl.eternal-september.org>
<uihnkd$21rae$1@dont-email.me>
<uihnnm$21tq7$5@raubtier-asyl.eternal-september.org>
<uihnup$21rab$4@dont-email.me>
<uihpgl$227kv$1@raubtier-asyl.eternal-september.org>
<uihpmf$228mv$1@dont-email.me>
<uihq1g$2290l$1@raubtier-asyl.eternal-september.org>
<uihr3u$228mv$11@dont-email.me>
<uihram$22gqs$1@raubtier-asyl.eternal-september.org>
<uihrd6$228mv$13@dont-email.me>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 Nov 2023 03:06:19 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="18b2886e41555d2d68af11cb4f52fad3";
logging-data="3338298"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19j+ZG34PBws2PmIofg3ArDlGkXRTWbCkA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:FUN7jvZRXi2acvglblY7xBs6ryo=
Content-Language: de-DE
In-Reply-To: <88V5N.33567$Ee89.15971@fx17.iad>
 by: Bonita Montero - Sat, 18 Nov 2023 03:06 UTC

Am 18.11.2023 um 03:16 schrieb Pavel:

> There is no system call in UNIX to wait for many conditions to be met at
> once; but I do not see why it would be useful.

poll() and wait() wait for at least one condition to be met.

Re: A Java- / .NET-like monitor

<CS66N.35203$cAm7.7747@fx18.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2694&group=comp.lang.c%2B%2B#2694

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uigp4n$1onpc$1@raubtier-asyl.eternal-september.org>
<20231108152102.495@kylheku.com>
<uihnei$21tq7$1@raubtier-asyl.eternal-september.org>
<uihnkd$21rae$1@dont-email.me>
<uihnnm$21tq7$5@raubtier-asyl.eternal-september.org>
<uihnup$21rab$4@dont-email.me>
<uihpgl$227kv$1@raubtier-asyl.eternal-september.org>
<uihpmf$228mv$1@dont-email.me>
<uihq1g$2290l$1@raubtier-asyl.eternal-september.org>
<uihr3u$228mv$11@dont-email.me>
<uihram$22gqs$1@raubtier-asyl.eternal-september.org>
<uihrd6$228mv$13@dont-email.me>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 11
Message-ID: <CS66N.35203$cAm7.7747@fx18.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sat, 18 Nov 2023 17:53:38 UTC
Date: Sat, 18 Nov 2023 12:53:30 -0500
X-Received-Bytes: 2076
 by: Pavel - Sat, 18 Nov 2023 17:53 UTC

Bonita Montero wrote:
> Am 18.11.2023 um 03:16 schrieb Pavel:
>
>> There is no system call in UNIX to wait for many conditions to be met
>> at once; but I do not see why it would be useful.
>
> poll() and wait() wait for at least one condition to be met.
what does it have to do with what I wrote?

Again, what a system call that waits for many conditions to be met at
once can be useful for?

Re: A Java- / .NET-like monitor

<ujb1rr$3e41l$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2695&group=comp.lang.c%2B%2B#2695

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 20:04:32 +0100
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <ujb1rr$3e41l$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<20231108152102.495@kylheku.com>
<uihnei$21tq7$1@raubtier-asyl.eternal-september.org>
<uihnkd$21rae$1@dont-email.me>
<uihnnm$21tq7$5@raubtier-asyl.eternal-september.org>
<uihnup$21rab$4@dont-email.me>
<uihpgl$227kv$1@raubtier-asyl.eternal-september.org>
<uihpmf$228mv$1@dont-email.me>
<uihq1g$2290l$1@raubtier-asyl.eternal-september.org>
<uihr3u$228mv$11@dont-email.me>
<uihram$22gqs$1@raubtier-asyl.eternal-september.org>
<uihrd6$228mv$13@dont-email.me>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 Nov 2023 19:04:27 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="18b2886e41555d2d68af11cb4f52fad3";
logging-data="3608629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/13ptrn5wfStYaS8yDFxDVDM6EPiemsDQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Yvi4hHDgJwDSyzTZXSDuuJSJeHU=
In-Reply-To: <CS66N.35203$cAm7.7747@fx18.iad>
Content-Language: de-DE
 by: Bonita Montero - Sat, 18 Nov 2023 19:04 UTC

Am 18.11.2023 um 18:53 schrieb Pavel:
> Bonita Montero wrote:
>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>
>>> There is no system call in UNIX to wait for many conditions to be met
>>> at once; but I do not see why it would be useful.
>>
>> poll() and wait() wait for at least one condition to be met.
> what does it have to do with what I wrote?
>
> Again, what a system call that waits for many conditions to be met at
> once can be useful for?

If you want to substitute a semaphore set with two eventfd()s you'd
should at best wait for both signalled together to avoid the discussed
double kernel call. As you this isn't possible with poll() or wait()
you can stick with normal posix semaphores, which do the same. The
best would be if you signal the waiting thread with a Posix signal,
then you can awake the thread upon an arbitrary state. I gues that's
what the glibc does, or I don't know another way to have only one
kernel voluntary context switch with pthread_cond_wait.

Re: A Java- / .NET-like monitor

<Tb86N.7506$xeV4.1209@fx45.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2696&group=comp.lang.c%2B%2B#2696

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org> <uihrg6$22hup$1@raubtier-asyl.eternal-september.org> <uihrj7$228mv$16@dont-email.me> <uihrm2$22ioe$1@raubtier-asyl.eternal-september.org> <uihrqr$228mv$19@dont-email.me> <uihs34$22jil$2@raubtier-asyl.eternal-september.org> <pMV4N.7286$pgLd.6741@fx05.iad> <uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org> <88V5N.33567$Ee89.15971@fx17.iad> <uj99na$35s1q$1@raubtier-asyl.eternal-september.org> <CS66N.35203$cAm7.7747@fx18.iad>
Lines: 16
Message-ID: <Tb86N.7506$xeV4.1209@fx45.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 18 Nov 2023 19:24:35 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 18 Nov 2023 19:24:35 GMT
X-Received-Bytes: 1536
 by: Scott Lurndal - Sat, 18 Nov 2023 19:24 UTC

Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>Bonita Montero wrote:
>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>
>>> There is no system call in UNIX to wait for many conditions to be met
>>> at once; but I do not see why it would be useful.
>>
>> poll() and wait() wait for at least one condition to be met.
>what does it have to do with what I wrote?
>
>Again, what a system call that waits for many conditions to be met at
>once can be useful for?

Rendezvous.

e.g. pthread_barrier_wait.

Re: A Java- / .NET-like monitor

<20231118122549.392@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2697&group=comp.lang.c%2B%2B#2697

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 20:29:51 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <20231118122549.392@kylheku.com>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
Injection-Date: Sat, 18 Nov 2023 20:29:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e494bd6bf0750eccdbc579c0b4d3dd08";
logging-data="3636574"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Spr6TA3SaRgb7imFnYu572geUfpQXtHw="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:Xl40tnnOwUkWoi7C8+2NzoRLkqQ=
 by: Kaz Kylheku - Sat, 18 Nov 2023 20:29 UTC

On 2023-11-18, Scott Lurndal <scott@slp53.sl.home> wrote:
> Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>>Bonita Montero wrote:
>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>
>>>> There is no system call in UNIX to wait for many conditions to be met
>>>> at once; but I do not see why it would be useful.
>>>
>>> poll() and wait() wait for at least one condition to be met.
>>what does it have to do with what I wrote?
>>
>>Again, what a system call that waits for many conditions to be met at
>>once can be useful for?
>
> Rendezvous.
>
> e.g. pthread_barrier_wait.

Also this:

while (!this_condition() && !that_condition() && !other_condition())
pthread_cond_wait(&cond, &mutex);

One condition variable can be used to wait for any subset of the
actual conditions over the shared variables protected by the mutex.

When I switched to a Win32 development job in the mid 1990's, it amused
me that Win32 had all these stupid things like WaitForMultipleObjects
(with a weird 64 limit), instead of just providing condition variables.

Today, Microsoft provides condition variables.

Modules of a large program should use callbacks to notify that something
is ready. That's the most flexible API. The caller can build proper
asynchronous control flows around that, or bind the callback to some
signaling object according to how they see fit.

Say I have a module that works with three other modules that can
spontaneously make some condition ready. If they all provide a callback,
I can set a flag in the callback and broadcast or signal a condition
variable. Then I can have threads wait for all three things to be
ready, or any one of the three things.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: A Java- / .NET-like monitor

<ujb7r2$3f4nr$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2698&group=comp.lang.c%2B%2B#2698

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!rocksolid2!i2pn.org!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 12:46:25 -0800
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <ujb7r2$3f4nr$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<20231108152102.495@kylheku.com>
<uihnei$21tq7$1@raubtier-asyl.eternal-september.org>
<uihnkd$21rae$1@dont-email.me>
<uihnnm$21tq7$5@raubtier-asyl.eternal-september.org>
<uihnup$21rab$4@dont-email.me>
<uihpgl$227kv$1@raubtier-asyl.eternal-september.org>
<uihpmf$228mv$1@dont-email.me>
<uihq1g$2290l$1@raubtier-asyl.eternal-september.org>
<uihr3u$228mv$11@dont-email.me>
<uihram$22gqs$1@raubtier-asyl.eternal-september.org>
<uihrd6$228mv$13@dont-email.me>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 Nov 2023 20:46:26 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c6bb7d11208b1d65e158106be7298c0f";
logging-data="3642107"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/rB1H3twSCTHjjH3yec1whsYiHQ5vVdvI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:AH5J3od3S9gVZr5TMOuALA2eI2Y=
Content-Language: en-US
In-Reply-To: <CS66N.35203$cAm7.7747@fx18.iad>
 by: Chris M. Thomasson - Sat, 18 Nov 2023 20:46 UTC

On 11/18/2023 9:53 AM, Pavel wrote:
> Bonita Montero wrote:
>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>
>>> There is no system call in UNIX to wait for many conditions to be met
>>> at once; but I do not see why it would be useful.
>>
>> poll() and wait() wait for at least one condition to be met.
> what does it have to do with what I wrote?
>
> Again, what a system call that waits for many conditions to be met at
> once can be useful for?

select?

Re: A Java- / .NET-like monitor

<kha6N.99517$wvv7.19903@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2699&group=comp.lang.c%2B%2B#2699

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org> <uihrj7$228mv$16@dont-email.me> <uihrm2$22ioe$1@raubtier-asyl.eternal-september.org> <uihrqr$228mv$19@dont-email.me> <uihs34$22jil$2@raubtier-asyl.eternal-september.org> <pMV4N.7286$pgLd.6741@fx05.iad> <uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org> <88V5N.33567$Ee89.15971@fx17.iad> <uj99na$35s1q$1@raubtier-asyl.eternal-september.org> <CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad> <20231118122549.392@kylheku.com>
Lines: 41
Message-ID: <kha6N.99517$wvv7.19903@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 18 Nov 2023 21:46:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 18 Nov 2023 21:46:56 GMT
X-Received-Bytes: 2669
 by: Scott Lurndal - Sat, 18 Nov 2023 21:46 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-11-18, Scott Lurndal <scott@slp53.sl.home> wrote:
>> Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>>>Bonita Montero wrote:
>>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>>
>>>>> There is no system call in UNIX to wait for many conditions to be met
>>>>> at once; but I do not see why it would be useful.
>>>>
>>>> poll() and wait() wait for at least one condition to be met.
>>>what does it have to do with what I wrote?
>>>
>>>Again, what a system call that waits for many conditions to be met at
>>>once can be useful for?
>>
>> Rendezvous.
>>
>> e.g. pthread_barrier_wait.
>
>Also this:
>
> while (!this_condition() && !that_condition() && !other_condition())
> pthread_cond_wait(&cond, &mutex);
>
>One condition variable can be used to wait for any subset of the
>actual conditions over the shared variables protected by the mutex.
>
>When I switched to a Win32 development job in the mid 1990's, it amused
>me that Win32 had all these stupid things like WaitForMultipleObjects
>(with a weird 64 limit), instead of just providing condition variables.

IIRC, that's a concept imported from VMS into NT by DC.

The Burroughs MCP had a 'complex wait' system call which could wait
for the occurance of any of a number of conditions (card reader ready,
tape unit ready, input ready from datacomm station, core-to-core
communication from cooperating process, inter-processor persistent
storage queue item availability, time delay, disk seek complete,
network data present, etc.

But it was a wait for any, not wait for all.

Re: A Java- / .NET-like monitor

<Xha6N.99518$wvv7.65238@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2700&group=comp.lang.c%2B%2B#2700

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org> <uihrj7$228mv$16@dont-email.me> <uihrm2$22ioe$1@raubtier-asyl.eternal-september.org> <uihrqr$228mv$19@dont-email.me> <uihs34$22jil$2@raubtier-asyl.eternal-september.org> <pMV4N.7286$pgLd.6741@fx05.iad> <uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org> <88V5N.33567$Ee89.15971@fx17.iad> <uj99na$35s1q$1@raubtier-asyl.eternal-september.org> <CS66N.35203$cAm7.7747@fx18.iad> <ujb7r2$3f4nr$1@dont-email.me>
Lines: 19
Message-ID: <Xha6N.99518$wvv7.65238@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 18 Nov 2023 21:47:35 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 18 Nov 2023 21:47:35 GMT
X-Received-Bytes: 1656
 by: Scott Lurndal - Sat, 18 Nov 2023 21:47 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>On 11/18/2023 9:53 AM, Pavel wrote:
>> Bonita Montero wrote:
>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>
>>>> There is no system call in UNIX to wait for many conditions to be met
>>>> at once; but I do not see why it would be useful.
>>>
>>> poll() and wait() wait for at least one condition to be met.
>> what does it have to do with what I wrote?
>>
>> Again, what a system call that waits for many conditions to be met at
>> once can be useful for?
>
>select?

I took Pavel to mean 'wait for all conditions to be true' rather than
'wait for one or more conditions to be true'.

Re: A Java- / .NET-like monitor

<ujbcaa$3ftah$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2701&group=comp.lang.c%2B%2B#2701

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 18 Nov 2023 14:02:50 -0800
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <ujbcaa$3ftah$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <ujb7r2$3f4nr$1@dont-email.me>
<Xha6N.99518$wvv7.65238@fx14.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 18 Nov 2023 22:02:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="c6bb7d11208b1d65e158106be7298c0f";
logging-data="3667281"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dIaef8LdWle2xXQLtpIPdrnN2YgBRgak="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ktDFdDxx/7dHdyR2mijUpGkmM/M=
Content-Language: en-US
In-Reply-To: <Xha6N.99518$wvv7.65238@fx14.iad>
 by: Chris M. Thomasson - Sat, 18 Nov 2023 22:02 UTC

On 11/18/2023 1:47 PM, Scott Lurndal wrote:
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>> On 11/18/2023 9:53 AM, Pavel wrote:
>>> Bonita Montero wrote:
>>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>>
>>>>> There is no system call in UNIX to wait for many conditions to be met
>>>>> at once; but I do not see why it would be useful.
>>>>
>>>> poll() and wait() wait for at least one condition to be met.
>>> what does it have to do with what I wrote?
>>>
>>> Again, what a system call that waits for many conditions to be met at
>>> once can be useful for?
>>
>> select?
>
> I took Pavel to mean 'wait for all conditions to be true' rather than
> 'wait for one or more conditions to be true'.
>

Ahhh. I missed that. Sorry everybody! ;^o

Re: A Java- / .NET-like monitor

<gfd6N.6512$qqwd.5177@fx42.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2702&group=comp.lang.c%2B%2B#2702

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx42.iad.POSTED!not-for-mail
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <Tb86N.7506$xeV4.1209@fx45.iad>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 28
Message-ID: <gfd6N.6512$qqwd.5177@fx42.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sun, 19 Nov 2023 01:09:32 UTC
Date: Sat, 18 Nov 2023 20:09:26 -0500
X-Received-Bytes: 2430
 by: Pavel - Sun, 19 Nov 2023 01:09 UTC

Scott Lurndal wrote:
> Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>> Bonita Montero wrote:
>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>
>>>> There is no system call in UNIX to wait for many conditions to be met
>>>> at once; but I do not see why it would be useful.
>>>
>>> poll() and wait() wait for at least one condition to be met.
>> what does it have to do with what I wrote?
>>
>> Again, what a system call that waits for many conditions to be met at
>> once can be useful for?
>
> Rendezvous.
Is it even useful? I got familiar with it first in late 80s while
learning Ada but never needed it since, even as a concept.
> e.g. pthread_barrier_wait.

It seems to work well as it is, my feeling is that implementing it in
user space on top of some "wait_for_all_xxxs" (which is on itself too
high-level for my taste) would not be efficient.

After giving it some thought, I think I could write a reasonable
implementation with 1 mutex, 1 condvar and 2 ints (unless some
"predictable scheduling policy" is required -- but the implementation
with "wait_for_all_xxxs" should have issue with it as well).

Re: A Java- / .NET-like monitor

<und6N.101929$wvv7.2130@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2703&group=comp.lang.c%2B%2B#2703

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <20231118122549.392@kylheku.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 54
Message-ID: <und6N.101929$wvv7.2130@fx14.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sun, 19 Nov 2023 01:18:18 UTC
Date: Sat, 18 Nov 2023 20:18:18 -0500
X-Received-Bytes: 3419
 by: Pavel - Sun, 19 Nov 2023 01:18 UTC

Kaz Kylheku wrote:
> On 2023-11-18, Scott Lurndal <scott@slp53.sl.home> wrote:
>> Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> writes:
>>> Bonita Montero wrote:
>>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>>
>>>>> There is no system call in UNIX to wait for many conditions to be met
>>>>> at once; but I do not see why it would be useful.
>>>>
>>>> poll() and wait() wait for at least one condition to be met.
>>> what does it have to do with what I wrote?
>>>
>>> Again, what a system call that waits for many conditions to be met at
>>> once can be useful for?
>>
>> Rendezvous.
>>
>> e.g. pthread_barrier_wait.
>
> Also this:
>
> while (!this_condition() && !that_condition() && !other_condition())
> pthread_cond_wait(&cond, &mutex);

I had to solve similar tasks once in a while, would usually just have a
count of conditions left or a mask of condition wanted as bits and the
thread satisfying a condition would only signal once count is zero or
the mask covers all conditions, respectively to
- avoid unnecessary wake-ups;
- let waiters check that count or mask instead of doing multiple checks

>
> One condition variable can be used to wait for any subset of the
> actual conditions over the shared variables protected by the mutex.
>
> When I switched to a Win32 development job in the mid 1990's, it amused
> me that Win32 had all these stupid things like WaitForMultipleObjects
> (with a weird 64 limit), instead of just providing condition variables.
>
> Today, Microsoft provides condition variables.
>
> Modules of a large program should use callbacks to notify that something
> is ready. That's the most flexible API. The caller can build proper
> asynchronous control flows around that, or bind the callback to some
> signaling object according to how they see fit.
>
> Say I have a module that works with three other modules that can
> spontaneously make some condition ready. If they all provide a callback,
> I can set a flag in the callback and broadcast or signal a condition
> variable. Then I can have threads wait for all three things to be
> ready, or any one of the three things.
>

Re: A Java- / .NET-like monitor

<mpd6N.101930$wvv7.24116@fx14.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2704&group=comp.lang.c%2B%2B#2704

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
Subject: Re: A Java- / .NET-like monitor
Newsgroups: comp.lang.c++
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <ujb7r2$3f4nr$1@dont-email.me>
<Xha6N.99518$wvv7.65238@fx14.iad> <ujbcaa$3ftah$1@dont-email.me>
From: pauldont...@removeyourself.dontspam.yahoo (Pavel)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.17.1
MIME-Version: 1.0
In-Reply-To: <ujbcaa$3ftah$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 26
Message-ID: <mpd6N.101930$wvv7.24116@fx14.iad>
X-Complaints-To: https://www.astraweb.com/aup
NNTP-Posting-Date: Sun, 19 Nov 2023 01:20:18 UTC
Date: Sat, 18 Nov 2023 20:20:18 -0500
X-Received-Bytes: 2277
 by: Pavel - Sun, 19 Nov 2023 01:20 UTC

Chris M. Thomasson wrote:
> On 11/18/2023 1:47 PM, Scott Lurndal wrote:
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>>> On 11/18/2023 9:53 AM, Pavel wrote:
>>>> Bonita Montero wrote:
>>>>> Am 18.11.2023 um 03:16 schrieb Pavel:
>>>>>
>>>>>> There is no system call in UNIX to wait for many conditions to be met
>>>>>> at once; but I do not see why it would be useful.
>>>>>
>>>>> poll() and wait() wait for at least one condition to be met.
>>>> what does it have to do with what I wrote?
>>>>
>>>> Again, what a system call that waits for many conditions to be met at
>>>> once can be useful for?
>>>
>>> select?
>>
>> I took Pavel to mean 'wait for all conditions to be true' rather than
>> 'wait for one or more conditions to be true'.
>>
>
> Ahhh. I missed that. Sorry everybody! ;^o
NP, Scott is correct, this was about "wait for many conditions to be met
at once" that Bonita missed on Linux for some reason I still cannot get
or relate to.

Re: A Java- / .NET-like monitor

<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2705&group=comp.lang.c%2B%2B#2705

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 05:58:24 +0100
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 04:58:18 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="5188d23c02781bdaeb3c144e123c43f6";
logging-data="3886624"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194Q7XYXwx5mFdvV4KbHro7zbuNZ0J7J2k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:etjSwdUqYA6QRIb1Qk0av2Hvcvk=
In-Reply-To: <Tb86N.7506$xeV4.1209@fx45.iad>
Content-Language: de-DE
 by: Bonita Montero - Sun, 19 Nov 2023 04:58 UTC

Am 18.11.2023 um 20:24 schrieb Scott Lurndal:

> e.g. pthread_barrier_wait.

pthread_barrier_wait is for multiple threads joining on one event,
not one thread waiting for multiple events as discussed.

Re: A Java- / .NET-like monitor

<20231118205852.379@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2706&group=comp.lang.c%2B%2B#2706

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 05:02:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20231118205852.379@kylheku.com>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
Injection-Date: Sun, 19 Nov 2023 05:02:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="31df926033aedc09467e779698b52aa2";
logging-data="3887247"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+99kHPTvKZ3Tf1nXV9mrdXGgeorr/FUos="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:n0+fonKF+ElHmPTDpaSW7ESWwF0=
 by: Kaz Kylheku - Sun, 19 Nov 2023 05:02 UTC

On 2023-11-19, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 18.11.2023 um 20:24 schrieb Scott Lurndal:
>
>> e.g. pthread_barrier_wait.
>
> pthread_barrier_wait is for multiple threads joining on one event,
> not one thread waiting for multiple events as discussed.

That is untrue; there are effectively N events in a barrier:

- thread 1 has arrived at the barrier
- thread 2 has arrived at the barrier
....
- thread N has arrived at the barrier

When all these events have occurred, then all threads at the barrier are
released (and an indication is given to one of them that it is the
special "serial thread").

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: A Java- / .NET-like monitor

<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2707&group=comp.lang.c%2B%2B#2707

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.samoylyk.net!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 07:00:51 +0100
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 06:00:45 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="5188d23c02781bdaeb3c144e123c43f6";
logging-data="3902367"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DdJmg5kmWiilV6OH7KKXAy6VbJoQLkJc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7uwU9h/iy2RAc/rbTFPOMPtdcUE=
Content-Language: de-DE
In-Reply-To: <20231118205852.379@kylheku.com>
 by: Bonita Montero - Sun, 19 Nov 2023 06:00 UTC

Am 19.11.2023 um 06:02 schrieb Kaz Kylheku:
> On 2023-11-19, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>> Am 18.11.2023 um 20:24 schrieb Scott Lurndal:
>>
>>> e.g. pthread_barrier_wait.
>>
>> pthread_barrier_wait is for multiple threads joining on one event,
>> not one thread waiting for multiple events as discussed.
>
> That is untrue; there are effectively N events in a barrier:

No, a barrier internally consists of an atomic which each thread
decrements and if it wasn't the last thread decrementing the atomic
it waits for a semaphore, a.k.a. event, which is signalled by the
last thread which decremented the atomic.

Re: A Java- / .NET-like monitor

<20231118220242.793@kylheku.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2708&group=comp.lang.c%2B%2B#2708

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: 864-117-...@kylheku.com (Kaz Kylheku)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 06:08:25 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20231118220242.793@kylheku.com>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
Injection-Date: Sun, 19 Nov 2023 06:08:25 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="31df926033aedc09467e779698b52aa2";
logging-data="3903580"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Dxx6zrQ4hueXLwDQqeA4SsINJ/N0G0qc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:N1Nc4V+uCulkfWkxBScHPb0Yumk=
 by: Kaz Kylheku - Sun, 19 Nov 2023 06:08 UTC

On 2023-11-19, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> Am 19.11.2023 um 06:02 schrieb Kaz Kylheku:
>> On 2023-11-19, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>>> Am 18.11.2023 um 20:24 schrieb Scott Lurndal:
>>>
>>>> e.g. pthread_barrier_wait.
>>>
>>> pthread_barrier_wait is for multiple threads joining on one event,
>>> not one thread waiting for multiple events as discussed.
>>
>> That is untrue; there are effectively N events in a barrier:
>
> No, a barrier internally consists of an atomic which each thread
> decrements

That's an implementation detail. Because the events are one-shots we can
just use a counter to represent the state that we need for the barrier
to be able to conclude that all events have occurred.

Each "thread P is waiting for barrier" event is a one shot, because
once a thread is waiting, that fact stays latched.

If the waiting threads could get nervous and leave the barrier
before it activates, then a counter could not be used; there would
have to be a set representation like a bitmask.

Rest unread.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca
NOTE: If you use Google Groups, I don't see you, unless you're whitelisted.

Re: A Java- / .NET-like monitor

<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2710&group=comp.lang.c%2B%2B#2710

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 12:05:21 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 11:05:15 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="5188d23c02781bdaeb3c144e123c43f6";
logging-data="3981800"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/E6hAhbUAWVDfMtst4d8ipYQ8TJMc2V94="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0e1i4d6KF0D/esJDBOd0OnXNJp4=
In-Reply-To: <20231118220242.793@kylheku.com>
Content-Language: de-DE
 by: Bonita Montero - Sun, 19 Nov 2023 11:05 UTC

Am 19.11.2023 um 07:08 schrieb Kaz Kylheku:

> That's an implementation detail. ...

That's how it works.
So from the scheduling / kernel perspective there's only one event.

Re: A Java- / .NET-like monitor

<ujdq0m$3u8mv$7@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2714&group=comp.lang.c%2B%2B#2714

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 12:08:54 -0800
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <ujdq0m$3u8mv$7@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 20:08:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="26803417fac4b0c1b76764e54e58e1a6";
logging-data="4137695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19al3RZhiQK4qPYi5HGx44F1QyoNYg6JNw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:e1SZ2ujO7hMG+0SoxHiJdw6VEj8=
In-Reply-To: <ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
Content-Language: en-US
 by: Chris M. Thomasson - Sun, 19 Nov 2023 20:08 UTC

On 11/19/2023 3:05 AM, Bonita Montero wrote:
> Am 19.11.2023 um 07:08 schrieb Kaz Kylheku:
>
>> That's an implementation detail. ...
>
> That's how it works.
> So from the scheduling / kernel perspective there's only one event.
>
>

I suspect that you are unfamiliar with how WaitForMultipleObjects
works... I remember a test for 50,000 concurrent connections, that was
mentioned by Microsoft. It was testing events vs IOCP. Did you know that
they recommended altering the indexes of the events waited for by
WaitForMultipleObjects? I remember it, is was a long time ago, 2001 ish,
iirc.

Iirc, it was recommended to basically randomize, or shift the indexes.
God damn, I need to find that old post on msdn. Again, iirc, if we did
not do this, some events could starve in the server experiment.

The funny part is that the event based model performed pretty good, not
as scalable as IOCP, however, IOCP did not completely blow it out of the
water wrt performance and throughput.

Re: A Java- / .NET-like monitor

<ujdq6f$3u8mv$8@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2715&group=comp.lang.c%2B%2B#2715

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 12:11:58 -0800
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <ujdq6f$3u8mv$8@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
<ujdq0m$3u8mv$7@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 20:11:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="26803417fac4b0c1b76764e54e58e1a6";
logging-data="4137695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+PANRlTZ6EMYp3DBQCam7AVkwDC0N41U8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oP1WW6JBha+rGTyj13hcYoHXY98=
In-Reply-To: <ujdq0m$3u8mv$7@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Sun, 19 Nov 2023 20:11 UTC

On 11/19/2023 12:08 PM, Chris M. Thomasson wrote:
> On 11/19/2023 3:05 AM, Bonita Montero wrote:
>> Am 19.11.2023 um 07:08 schrieb Kaz Kylheku:
>>
>>> That's an implementation detail. ...
>>
>> That's how it works.
>> So from the scheduling / kernel perspective there's only one event.
>>
>>
>
> I suspect that you are unfamiliar with how WaitForMultipleObjects
> works... I remember a test for 50,000 concurrent connections, that was
> mentioned by Microsoft. It was testing events vs IOCP. Did you know that
> they recommended altering the indexes of the events waited for by
> WaitForMultipleObjects? I remember it, is was a long time ago, 2001 ish,
> iirc.
>
> Iirc, it was recommended to basically randomize, or shift the indexes.
> God damn, I need to find that old post on msdn. Again, iirc, if we did
> not do this, some events could starve in the server experiment.
>
> The funny part is that the event based model performed pretty good, not
> as scalable as IOCP, however, IOCP did not completely blow it out of the
> water wrt performance and throughput.

After I read that msdn post, I basically created a proxy server. One
using events, and another using IOCP. IOCP beats it, but did not
slaughter it at that time. I found that to be interesting.

Re: A Java- / .NET-like monitor

<ujdqgi$3u8mv$9@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2716&group=comp.lang.c%2B%2B#2716

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 19 Nov 2023 12:17:21 -0800
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <ujdqgi$3u8mv$9@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
<ujdq0m$3u8mv$7@dont-email.me> <ujdq6f$3u8mv$8@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 19 Nov 2023 20:17:22 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="26803417fac4b0c1b76764e54e58e1a6";
logging-data="4137695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oj8VcCiED3krrjG+aoBQZa+RFubYTE1E="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:v4UvlEjm+/Tmt4irXSO4cvpcdLc=
Content-Language: en-US
In-Reply-To: <ujdq6f$3u8mv$8@dont-email.me>
 by: Chris M. Thomasson - Sun, 19 Nov 2023 20:17 UTC

On 11/19/2023 12:11 PM, Chris M. Thomasson wrote:
> On 11/19/2023 12:08 PM, Chris M. Thomasson wrote:
>> On 11/19/2023 3:05 AM, Bonita Montero wrote:
>>> Am 19.11.2023 um 07:08 schrieb Kaz Kylheku:
>>>
>>>> That's an implementation detail. ...
>>>
>>> That's how it works.
>>> So from the scheduling / kernel perspective there's only one event.
>>>
>>>
>>
>> I suspect that you are unfamiliar with how WaitForMultipleObjects
>> works... I remember a test for 50,000 concurrent connections, that was
>> mentioned by Microsoft. It was testing events vs IOCP. Did you know
>> that they recommended altering the indexes of the events waited for by
>> WaitForMultipleObjects? I remember it, is was a long time ago, 2001
>> ish, iirc.
>>
>> Iirc, it was recommended to basically randomize, or shift the indexes.
>> God damn, I need to find that old post on msdn. Again, iirc, if we did
>> not do this, some events could starve in the server experiment.
>>
>> The funny part is that the event based model performed pretty good,
>> not as scalable as IOCP, however, IOCP did not completely blow it out
>> of the water wrt performance and throughput.
>
> After I read that msdn post, I basically created a proxy server. One
> using events, and another using IOCP. IOCP beats it, but did not
> slaughter it at that time. I found that to be interesting.

That's way back when I remember using AIO for the HTTP proxy server over
on Linux and compared it to IOCP. Time flies!

Re: A Java- / .NET-like monitor

<ujfj9t$admf$1@raubtier-asyl.eternal-september.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2722&group=comp.lang.c%2B%2B#2722

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 20 Nov 2023 13:26:43 +0100
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <ujfj9t$admf$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
<ujdq0m$3u8mv$7@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Nov 2023 12:26:37 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="8cbc891aa481e21287c9545afd3e486e";
logging-data="341711"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+23zzM+k8cGPsd7u4cssH7LW54nztvuaE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sRgMA2WjQm6Ya8kaYDgtnxYO2+U=
In-Reply-To: <ujdq0m$3u8mv$7@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Mon, 20 Nov 2023 12:26 UTC

Am 19.11.2023 um 21:08 schrieb Chris M. Thomasson:

> I suspect that you are unfamiliar with how WaitForMultipleObjects
> works... ...

Absolutely not, but with WFMO you'd need a lot of semaphores or events
whereas my solution needs one semaphore and you'd be limited to MAXIMUM
_WAIT_OBJECTS == 64 threads which can join the barrier.
And why do you think I didn't know that ? I've shown that I used that
with my monitor and you even didn't have to look at the source since
I've explained that I'm using WFMO multiple times.

Re: A Java- / .NET-like monitor

<ujgeu8$evq1$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=2726&group=comp.lang.c%2B%2B#2726

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 20 Nov 2023 12:18:15 -0800
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <ujgeu8$evq1$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<uihrg6$22hup$1@raubtier-asyl.eternal-september.org>
<uihrj7$228mv$16@dont-email.me>
<uihrm2$22ioe$1@raubtier-asyl.eternal-september.org>
<uihrqr$228mv$19@dont-email.me>
<uihs34$22jil$2@raubtier-asyl.eternal-september.org>
<pMV4N.7286$pgLd.6741@fx05.iad>
<uj1jli$1kdmu$1@raubtier-asyl.eternal-september.org>
<88V5N.33567$Ee89.15971@fx17.iad>
<uj99na$35s1q$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<ujc4la$3mjh0$1@raubtier-asyl.eternal-september.org>
<20231118205852.379@kylheku.com>
<ujc8ad$3n2sv$1@raubtier-asyl.eternal-september.org>
<20231118220242.793@kylheku.com>
<ujcq5b$3pgf8$2@raubtier-asyl.eternal-september.org>
<ujdq0m$3u8mv$7@dont-email.me>
<ujfj9t$admf$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 20 Nov 2023 20:18:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="4322877222dc651c772ffc6c8629112a";
logging-data="491329"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18bKTg0qTUza7nrn0CqaJzLQzTNebADcag="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:C/oWQu5PvO76/xTj1TYI20CWouA=
Content-Language: en-US
In-Reply-To: <ujfj9t$admf$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Mon, 20 Nov 2023 20:18 UTC

On 11/20/2023 4:26 AM, Bonita Montero wrote:
> Am 19.11.2023 um 21:08 schrieb Chris M. Thomasson:
>
>> I suspect that you are unfamiliar with how WaitForMultipleObjects
>> works... ...
>
> Absolutely not, but with WFMO you'd need a lot of semaphores or events
> whereas my solution needs one semaphore and you'd be limited to MAXIMUM
> _WAIT_OBJECTS == 64 threads which can join the barrier.
> And why do you think I didn't know that ? I've shown that I used that
> with my monitor and you even didn't have to look at the source since
> I've explained that I'm using WFMO multiple times.
>

I was just thinking about the case that did not have to wait on all the
events your are passing into WFMO to be in a signaled state. That old
50,000 connection test (event vs. iocp) required us to shift their
positions in the array in order to get around some starvation issues...

Did you read that article on MSDN as well? Iirc, its around 20 years old.


devel / comp.lang.c++ / Re: A Java- / .NET-like monitor

Pages:1234567891011
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor