Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

It's later than you think, the joint Russian-American space mission has already begun.


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

<%Wr8N.40010$zh16.35086@fx48.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.swapon.de!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@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> <CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad> <20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com> <ujpcnq$27892$1@dont-email.me> <ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org> <ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad> <20231124102842.71@kylheku.com> <ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org> <20231125100947.641@kylheku.com>
Lines: 14
Message-ID: <%Wr8N.40010$zh16.35086@fx48.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sat, 25 Nov 2023 19:30:03 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sat, 25 Nov 2023 19:30:03 GMT
X-Received-Bytes: 1617
 by: Scott Lurndal - Sat, 25 Nov 2023 19:30 UTC

Kaz Kylheku <864-117-4973@kylheku.com> writes:
>On 2023-11-25, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>> Am 24.11.2023 um 19:33 schrieb Kaz Kylheku:
>>
>>> It's just a syntactic sugar to avoid forgetting to unlock ...
>>
>> RAII is magnitudes more convenient and lass error-prone
>> than manual resource handling.
>
>Sure, but that's not necessarily an effective way to "sell" it to
>someone who is being skeptical.

I would argue that is is not 'less error-prone' than
explicit locking, properly written and unit tested.

Re: A Java- / .NET-like monitor

<ujtti0$2v76e$3@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 25 Nov 2023 14:47:28 -0800
Organization: A noiseless patient Spider
Lines: 79
Message-ID: <ujtti0$2v76e$3@dont-email.me>
References: <uig7jl$1l4v0$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> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com> <ujrc8c$2gjhg$3@dont-email.me>
<3Wa8N.2235$PJoc.2084@fx04.iad> <ujrf2b$2gqoe$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 25 Nov 2023 22:47:28 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a478786200890072e344b77cbd100045";
logging-data="3120334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pgaLZ/oVZBzeRJYhK6/08yPEwOHGrvoI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:r59L28c57Fv5nUp6t5l/4H7iBIo=
In-Reply-To: <ujrf2b$2gqoe$2@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 25 Nov 2023 22:47 UTC

On 11/24/2023 4:27 PM, Chris M. Thomasson wrote:
> On 11/24/2023 4:08 PM, Scott Lurndal wrote:
>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>>> On 11/24/2023 10:33 AM, Kaz Kylheku wrote:
>>>> On 2023-11-24, Scott Lurndal <scott@slp53.sl.home> wrote:
>>>>> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>>>>>> On 11/23/2023 11:59 PM, Bonita Montero wrote:
>>>>>>> Am 24.11.2023 um 06:35 schrieb Chris M. Thomasson:
>>>>>>>
>>>>>>>> On 11/23/2023 3:14 PM, Michael S wrote:
>>>>>>>
>>>>>>>>> Which, I would guess, never used by 99.9% of programs that were
>>>>>>>>> not
>>>>>>>>> ported to Windows from some other platform.
>>>>>>>
>>>>>>>> Fwiw, check this out:
>>>>>>>> https://sourceware.org/pthreads-win32/
>>>>>>>
>>>>>>> Am 24.11.2023 um 06:35 schrieb Chris M. Thomasson:
>>>>>>>
>>>>>>> That's an unnecessary discussion for a C++ programmer since the
>>>>>>> RAII-ish
>>>>>>> mutexes and condition variables since C++11 are more convenient
>>>>>>> to use.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Have you ever wrapped up a C API in C++ using RAII before?
>>>>>
>>>>> I generally consider using RAII for synchronization primitives
>>>>> to be counterindicated.    Amongst the reasons:
>>>>>    1) The critical sections usually end up being far to large
>>>>
>>>> Use braces?
>>>>
>>>>      {
>>>>         mutex_locker m(obj);
>>>>
>>>>
>>>>      }
>>>
>>> DING!!! :^)
>>
>> No, not really.  It's not always that
>> easy, and sometimes programmers even use 'goto'.
>>
>> That's certainly no more readable than
>>
>>     pthread_lock(obj);
>>
>>     do something
>>
>>     pthread_unlock(obj);
>>
>> I'd argue the RAII solution is less readable.
>
> RAII can come in handy. I don't think its all that bad. Humm...
> _______________________
> {
>    mutex_raii_lock(my_lock);
^^^^^^^^^^^^^

OOPS!
mutex_raii_lock lock(my_lock);

> }
> _______________________
>
> vs:
> _______________________
> my_lock.lock();
> my_lock.unlock();
> _______________________
>
> Btw, wrt C++, RAII tends to work rather well with exceptions... ;^)

Re: A Java- / .NET-like monitor

<ujtu5d$2v76e$4@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 25 Nov 2023 14:57:49 -0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <ujtu5d$2v76e$4@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 25 Nov 2023 22:57:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="a478786200890072e344b77cbd100045";
logging-data="3120334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1931m5HIbouYVL3eRUGKXrfhPThx8LR7ck="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:8F/HVBtUQEyhy2AEa48urvPMCtg=
In-Reply-To: <%Wr8N.40010$zh16.35086@fx48.iad>
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 25 Nov 2023 22:57 UTC

On 11/25/2023 11:30 AM, Scott Lurndal wrote:
> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>> On 2023-11-25, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>>> Am 24.11.2023 um 19:33 schrieb Kaz Kylheku:
>>>
>>>> It's just a syntactic sugar to avoid forgetting to unlock ...
>>>
>>> RAII is magnitudes more convenient and lass error-prone
>>> than manual resource handling.
>>
>> Sure, but that's not necessarily an effective way to "sell" it to
>> someone who is being skeptical.
>
> I would argue that is is not 'less error-prone' than
> explicit locking, properly written and unit tested.

It can create a dog with different fleas in some cases.

Re: A Java- / .NET-like monitor

<ujtuku$2v76e$5@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 25 Nov 2023 15:06:06 -0800
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <ujtuku$2v76e$5@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 25 Nov 2023 23:06:06 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b708f4c2d8e5bc3081b7bf719c480e97";
logging-data="3120334"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BLqTdsEGgyCeKdCSfXSraoIf6LQABfQg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:fKeiG3Xe8AXKuRIpOATY2b2wSC4=
In-Reply-To: <ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 25 Nov 2023 23:06 UTC

On 11/25/2023 4:04 AM, Bonita Montero wrote:
> Am 25.11.2023 um 00:43 schrieb Chris M. Thomasson:
>
>> How would that even work? You do not need to create an event per
>> connection in IOCP model. IOCP is a different model that is not
>> compatible with WFMO.
>
> You'd have to ask GQCS after you waited.

Huh? Drill down on that. What do you mean wrt "_after_ you waited"?

> Actually WFMO works
> on a IOCP für my Windows 11 PC, but this isn't documented.

So your hack can break at any time? Keep in mind that I said GQCSEX...
:^) Its more efficient that GQCS. Actually, have you ever read a paper
on server design that used cohort scheduling?

Re: A Java- / .NET-like monitor

<20231126012940.00001397@yahoo.com>

  copy mid

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

  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: already5chosen@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 01:29:40 +0200
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <20231126012940.00001397@yahoo.com>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad>
<Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com>
<20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me>
<bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com>
<%Wr8N.40010$zh16.35086@fx48.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="ae4dcef5b74f9a5d300ea9cd756357cb";
logging-data="3126105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Rle956P2xZMcyI9ptfyw6gDmj3+kwW38="
Cancel-Lock: sha1:yIa5BMLTcW4c6zmyvK+WqlM/uAM=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Sat, 25 Nov 2023 23:29 UTC

On Sat, 25 Nov 2023 19:30:03 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:

> Kaz Kylheku <864-117-4973@kylheku.com> writes:
> >On 2023-11-25, Bonita Montero <Bonita.Montero@gmail.com> wrote:
> >> Am 24.11.2023 um 19:33 schrieb Kaz Kylheku:
> >>
> >>> It's just a syntactic sugar to avoid forgetting to unlock ...
> >>
> >> RAII is magnitudes more convenient and lass error-prone
> >> than manual resource handling.
> >
> >Sure, but that's not necessarily an effective way to "sell" it to
> >someone who is being skeptical.
>
> I would argue that is is not 'less error-prone' than
> explicit locking, properly written and unit tested.

RAII is horrible, but unfortunately necessary in big undisciplined C++
projects.
The root bug in C++ language design are constructors that can fail, but
can't return error code.
That problem begot exceptions. And the presence of exceptions begot
RAII. RAII is bad, but less bad than other solutions.

Re: A Java- / .NET-like monitor

<uju1ij$2voqe$1@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sat, 25 Nov 2023 15:56:03 -0800
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <uju1ij$2voqe$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 25 Nov 2023 23:56:03 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b708f4c2d8e5bc3081b7bf719c480e97";
logging-data="3138382"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+36s8ZQJpxCWXuTCxZvPsq3fuTiZcbzEU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:qUWdQlb40zV8UY40l2FXYKVKHmM=
In-Reply-To: <20231126012940.00001397@yahoo.com>
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 25 Nov 2023 23:56 UTC

On 11/25/2023 3:29 PM, Michael S wrote:
> On Sat, 25 Nov 2023 19:30:03 GMT
> scott@slp53.sl.home (Scott Lurndal) wrote:
>
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-11-25, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>>>> Am 24.11.2023 um 19:33 schrieb Kaz Kylheku:
>>>>
>>>>> It's just a syntactic sugar to avoid forgetting to unlock ...
>>>>
>>>> RAII is magnitudes more convenient and lass error-prone
>>>> than manual resource handling.
>>>
>>> Sure, but that's not necessarily an effective way to "sell" it to
>>> someone who is being skeptical.
>>
>> I would argue that is is not 'less error-prone' than
>> explicit locking, properly written and unit tested.
>
> RAII is horrible, but unfortunately necessary in big undisciplined C++
> projects.

Horrible? It's not that bad.

> The root bug in C++ language design are constructors that can fail, but
> can't return error code.
> That problem begot exceptions. And the presence of exceptions begot
> RAII. RAII is bad, but less bad than other solutions.
>
>
>

Re: A Java- / .NET-like monitor

<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 11:35:51 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 26 Nov 2023 10:35:51 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="fa349a80207e858afcfd1f8fb750f103";
logging-data="3405602"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/5Vk/1n8hF/pkMeHCYwHwYKcPbzLwPe9M="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:c/rNr4XUwAruPoPKud3XEhv5ipY=
Content-Language: de-DE
In-Reply-To: <ujtuku$2v76e$5@dont-email.me>
 by: Bonita Montero - Sun, 26 Nov 2023 10:35 UTC

Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:

> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?

If you want to wait mor than on the IOCP itself you could use WFMO
and if the IOCP was signalled GQCS afterwards. With an IOCP you can
wait only for the IOCP and maybe an alert if you use GQCSE.

> So your hack can break at any time? ...

It would be nice if MS would document since when this works.

> So your hack can break at any time? Keep in mind that I said GQCSEX...
> :^) Its more efficient that GQCS. ...

It's not about the efficiency but that you could be signalled other
waitable kernel objects also.

Re: A Java- / .NET-like monitor

<ujvf5l$3934n$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.1d4.us!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 13:54:12 +0100
Organization: A noiseless patient Spider
Lines: 51
Message-ID: <ujvf5l$3934n$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 26 Nov 2023 12:54:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aae92c7a77d1d7e918ee3bbc7df046b1";
logging-data="3443863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18W/LfDJxFxQ0H6oUFSOAqWXf4Cufx2h/o="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:94yCY5oBoRc27gFkNQBZ3ZX2nNE=
Content-Language: en-GB
In-Reply-To: <20231126012940.00001397@yahoo.com>
 by: David Brown - Sun, 26 Nov 2023 12:54 UTC

On 26/11/2023 00:29, Michael S wrote:
> On Sat, 25 Nov 2023 19:30:03 GMT
> scott@slp53.sl.home (Scott Lurndal) wrote:
>
>> Kaz Kylheku <864-117-4973@kylheku.com> writes:
>>> On 2023-11-25, Bonita Montero <Bonita.Montero@gmail.com> wrote:
>>>> Am 24.11.2023 um 19:33 schrieb Kaz Kylheku:
>>>>
>>>>> It's just a syntactic sugar to avoid forgetting to unlock ...
>>>>
>>>> RAII is magnitudes more convenient and lass error-prone
>>>> than manual resource handling.
>>>
>>> Sure, but that's not necessarily an effective way to "sell" it to
>>> someone who is being skeptical.
>>
>> I would argue that is is not 'less error-prone' than
>> explicit locking, properly written and unit tested.
>
> RAII is horrible, but unfortunately necessary in big undisciplined C++
> projects.
> The root bug in C++ language design are constructors that can fail, but
> can't return error code.

That's easily solved in cases like this - write constructors that can't
fail.

In the kind of systems I work with, something like acquiring a mutex
cannot fail unless there is a major system failure that renders it
unsafe to run anything - the system then turns off all the machinery it
controls, logs everything it can, and alerts the user to the failure.
That applies equally to a free-standing "lock" function or an RAII
constructor solution. There is no need for exceptions, error codes, or
anything of that sort.

> That problem begot exceptions. And the presence of exceptions begot
> RAII. RAII is bad, but less bad than other solutions.
>

I am not a fan of exceptions in low-level code or control code. They
are fine in high-level PC stuff when dealing with things that can
reasonably fail but where you don't want to bother with all the details
all the time - such as a constructor for opening a handle to a database.
(I mostly use Python for that kind of thing anyway, but that's just
personal choice.)

Once you stop thinking that code can fail, and write code that doesn't
fail, it all becomes much easier, and RAII is just another useful tool.
(And you can compile with exceptions fully disabled.)

Re: A Java- / .NET-like monitor

<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 14:38:58 +0100
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 26 Nov 2023 13:38:57 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="fa349a80207e858afcfd1f8fb750f103";
logging-data="3454887"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19eLm1EIug873ozgF/ERcPSX3kjfBvQm+k="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:G+h3dgL4prdcXj/u4fkTkkg6n5w=
In-Reply-To: <ujvf5l$3934n$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Sun, 26 Nov 2023 13:38 UTC

Am 26.11.2023 um 13:54 schrieb David Brown:

> Once you stop thinking that code can fail, and write code that doesn't
> fail, it all becomes much easier, and RAII is just another useful tool.
> (And you can compile with exceptions fully disabled.)

With exceptions and RAII failures are also very easy to handle because
you handle them only at a few places and not where they happen or in
the call levels between.
Avoiding exceptions looks hard to me because the runtime can throw a
lot of exceptions, mostly bad_alloc()s or system_error()s.

Re: A Java- / .NET-like monitor

<ujvo70$3adcv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!nntp.comgw.net!paganini.bofh.team!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 16:28:31 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <ujvo70$3adcv$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$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: Sun, 26 Nov 2023 15:28:32 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aae92c7a77d1d7e918ee3bbc7df046b1";
logging-data="3487135"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Zxql74Mps5zJq1YpLeq/w99SGgkN9Jf8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:gVoIz3fjNJcol9zUx4QBMgF4BZE=
Content-Language: en-GB
In-Reply-To: <ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
 by: David Brown - Sun, 26 Nov 2023 15:28 UTC

On 26/11/2023 14:38, Bonita Montero wrote:
> Am 26.11.2023 um 13:54 schrieb David Brown:
>
>> Once you stop thinking that code can fail, and write code that doesn't
>> fail, it all becomes much easier, and RAII is just another useful
>> tool. (And you can compile with exceptions fully disabled.)
>
> With exceptions and RAII failures are also very easy to handle because
> you handle them only at a few places and not where they happen or in
> the call levels between.

No, exceptions do not make things easier - they make them /different/.
Sometimes it might be helpful to move failure handling to a different
part of the code, sometimes it makes things harder. Sometimes it is
best to have a failure handling solution that does not care what can
fail, or how it can fail, and only think about failures when you have a
way to deal with them (that's exceptions). Sometimes it is best to be
entirely sure about wait failures can occur at the point of failure, and
deal with them or pass them on explicitly (that's error returns,
std::expect, railway programming, etc.). Sometimes it is best to ensure
failure is not possible within the scope of the software, so that no
failure handling is needed (or nothing beyond abort(), kernel panic, etc.)

The only thing you can be sure about with failure handling is that
anyone who says they know the perfect answer, or that their preferred
method is always far better than others, is wrong.

> Avoiding exceptions looks hard to me because the runtime can throw a
> lot of exceptions, mostly bad_alloc()s or system_error()s.
>

Any code that sees a "bad_alloc" exception is already borked. It is not
failing because of the exception, it is failing because of the bad
programming.

Re: A Java- / .NET-like monitor

<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 18:51:14 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 26 Nov 2023 17:51:13 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="fa349a80207e858afcfd1f8fb750f103";
logging-data="3527982"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kPo3VAhLAqgfLvunmPnu06FYYCpNUtuM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:39YCwf7j+VQuGte4iMxHcLlivc8=
Content-Language: de-DE
In-Reply-To: <ujvo70$3adcv$1@dont-email.me>
 by: Bonita Montero - Sun, 26 Nov 2023 17:51 UTC

Am 26.11.2023 um 16:28 schrieb David Brown:

> No, exceptions do not make things easier - they make them /different/.

Without exceptions you'd have to deal with return codes at each call
level; this *is* much more work.

> Sometimes it might be helpful to move failure handling to a different
> part of the code, sometimes it makes things harder.

In C++ exceptions are mostly used for resource collapse situations, i.e.
out of memory errors, network errors of filesystem failures. With that
exceptions are the most convenient way to handle that. These types of
errors are handled in most cases.

> Any code that sees a "bad_alloc" exception is already borked.

With exceptions you can handle such situations in a clean way with
a small effort.

> It is not failing because of the exception, it is failing because
> of the bad programming.

bad_alloc doesn't depend on the programming but rather how much memory
you have. You might ignore bad_alloc for small allocations since they're
unlikely to happen, but not for large allocations.
I don't understand your attitude while programming with C++ because the
runtime uses exceptions so much.

Re: A Java- / .NET-like monitor

<uk067q$3ck1o$1@dont-email.me>

  copy mid

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

  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: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 20:27:54 +0100
Organization: A noiseless patient Spider
Lines: 70
Message-ID: <uk067q$3ck1o$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$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: Sun, 26 Nov 2023 19:27:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="aae92c7a77d1d7e918ee3bbc7df046b1";
logging-data="3559480"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18yJmRfkNIjgQTjsMNpvi7jJRcZeUb5bnE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Juxtctk4JJKBIBLSeDY5oRYS6k8=
In-Reply-To: <uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
Content-Language: en-GB
 by: David Brown - Sun, 26 Nov 2023 19:27 UTC

On 26/11/2023 18:51, Bonita Montero wrote:
> Am 26.11.2023 um 16:28 schrieb David Brown:
>
>> No, exceptions do not make things easier - they make them /different/.
>
> Without exceptions you'd have to deal with return codes at each call
> level; this *is* much more work.

As I said, anyone who claims their preference is always right, is wrong.

>
>> Sometimes it might be helpful to move failure handling to a different
>> part of the code, sometimes it makes things harder.
>
> In C++ exceptions are mostly used for resource collapse situations, i.e.
> out of memory errors, network errors of filesystem failures.

These are completely different situations. /Sometimes/ exceptions are a
convenient way to handle network or filesystem issues. They are never a
good way of handling out of memory errors, because out of memory errors
are caused by failures of the code, not external causes.

> With that
> exceptions are the most convenient way to handle that. These types of
> errors are handled in most cases.
>

Back here in the real world, most exceptions are /not/ handled -
programmers implementing the lower level functions think that exceptions
are someone else's problem and pass the buck up the line. Programmers
implementing the higher level parts don't know that the lower level
parts might through an exception - they assume functions do what they
claim to do.

Used properly, exceptions can be helpful in some situations.
Unfortunately they are rarely used properly.

>> Any code that sees a "bad_alloc" exception is already borked.
>
> With exceptions you can handle such situations in a clean way with
> a small effort.
>

No, you can't. You cannot magically make more memory appear, nor
magically fix the crappy code that caused a memory error in the first
place. You are blindly buying into the myth.

>> It is not failing because of the exception, it is failing because
>> of the bad programming.
>
> bad_alloc doesn't depend on the programming but rather how much memory
> you have. You might ignore bad_alloc for small allocations since they're
> unlikely to happen, but not for large allocations.

If you are trying to make an allocation that is too big for the system,
you are doing things wrong. Throwing an exception does not help,
because catching the exception cannot help.

> I don't understand your attitude while programming with C++ because the
> runtime uses exceptions so much.
>

The C++ code I use never throws exceptions. I never have them enabled.
I don't miss them.

(I don't use C++ for the kinds of uses where exceptions can be helpful.)

Re: A Java- / .NET-like monitor

<uk0hdg$3ec6q$1@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 14:38:37 -0800
Organization: A noiseless patient Spider
Lines: 92
Message-ID: <uk0hdg$3ec6q$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 26 Nov 2023 22:38:40 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="b708f4c2d8e5bc3081b7bf719c480e97";
logging-data="3616986"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uGIsXak4hRgP+otw9iy+zr2u8h3YiCEM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Q+0Ui29gWIm0wBSwnrSJ0UShW+0=
In-Reply-To: <uk067q$3ck1o$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Sun, 26 Nov 2023 22:38 UTC

On 11/26/2023 11:27 AM, David Brown wrote:
> On 26/11/2023 18:51, Bonita Montero wrote:
>> Am 26.11.2023 um 16:28 schrieb David Brown:
>>
>>> No, exceptions do not make things easier - they make them /different/.
>>
>> Without exceptions you'd have to deal with return codes at each call
>> level; this *is* much more work.
>
> As I said, anyone who claims their preference is always right, is wrong.
>
>>
>>> Sometimes it might be helpful to move failure handling to a different
>>> part of the code, sometimes it makes things harder.
>>
>> In C++ exceptions are mostly used for resource collapse situations, i.e.
>> out of memory errors, network errors of filesystem failures.
>
> These are completely different situations.  /Sometimes/ exceptions are a
> convenient way to handle network or filesystem issues.  They are never a
> good way of handling out of memory errors, because out of memory errors
> are caused by failures of the code, not external causes.

Yup. One time I was experimenting with ways to allow a proxy server I
was coding up to die before exhausting non-paged memory by artificially
limiting the memory. This limit was used to make it go into a panic mode
even though it has exhausted all of the non-paged memory. It just got
too close. Iiic, it worked fairly well.

A panic mode would make the server drop all "stale", timedout, ect,
connections. It would also try to reclaim as much memory and resources
as it could, without cancelling currently active and working connections...

Basically, where you say:
________
They are never a good way of handling out of memory errors
________

Is true.

>
>> With that
>> exceptions are the most convenient way to handle that. These types of
>> errors are handled in most cases.
>>
>
> Back here in the real world, most exceptions are /not/ handled -
> programmers implementing the lower level functions think that exceptions
> are someone else's problem and pass the buck up the line.  Programmers
> implementing the higher level parts don't know that the lower level
> parts might through an exception - they assume functions do what they
> claim to do.
>
> Used properly, exceptions can be helpful in some situations.
> Unfortunately they are rarely used properly.
>
>>> Any code that sees a "bad_alloc" exception is already borked.
>>
>> With exceptions you can handle such situations in a clean way with
>> a small effort.
>>
>
> No, you can't.  You cannot magically make more memory appear, nor
> magically fix the crappy code that caused a memory error in the first
> place.  You are blindly buying into the myth.
>
>>> It is not failing because of the exception, it is failing because
>>> of the bad programming.
>>
>> bad_alloc doesn't depend on the programming but rather how much memory
>> you have. You might ignore bad_alloc for small allocations since they're
>> unlikely to happen, but not for large allocations.
>
> If you are trying to make an allocation that is too big for the system,
> you are doing things wrong.  Throwing an exception does not help,
> because catching the exception cannot help.
>
>> I don't understand your attitude while programming with C++ because the
>> runtime uses exceptions so much.
>>
>
> The C++ code I use never throws exceptions.  I never have them enabled.
> I don't miss them.
>
> (I don't use C++ for the kinds of uses where exceptions can be helpful.)
>
>
>
>

Re: A Java- / .NET-like monitor

<b1Q8N.30037$ayBd.16610@fx07.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx07.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@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> <ujpcnq$27892$1@dont-email.me> <ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org> <ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad> <20231124102842.71@kylheku.com> <ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org> <20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad> <20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me> <ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
Lines: 19
Message-ID: <b1Q8N.30037$ayBd.16610@fx07.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 26 Nov 2023 22:55:03 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 26 Nov 2023 22:55:03 GMT
X-Received-Bytes: 1971
 by: Scott Lurndal - Sun, 26 Nov 2023 22:55 UTC

Bonita Montero <Bonita.Montero@gmail.com> writes:
>Am 26.11.2023 um 13:54 schrieb David Brown:
>
>> Once you stop thinking that code can fail, and write code that doesn't
>> fail, it all becomes much easier, and RAII is just another useful tool.
>> (And you can compile with exceptions fully disabled.)
>
>With exceptions and RAII failures are also very easy to handle because
>you handle them only at a few places and not where they happen or in
>the call levels between.
>Avoiding exceptions looks hard to me because the runtime can throw a
>lot of exceptions, mostly bad_alloc()s or system_error()s.

Given that C++ predates the standard C++ library, it's clearly
possible to write C++ code without a runtime that throws a lot
of exceptions. (exceptions didn't show up until C++3.0).

It is also possible to build a runtime that never throws
exceptions.

Re: A Java- / .NET-like monitor

<uk0in9$3eibd$1@dont-email.me>

  copy mid

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

  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.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 15:00:54 -0800
Organization: A noiseless patient Spider
Lines: 112
Message-ID: <uk0in9$3eibd$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me> <uk0hdg$3ec6q$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 26 Nov 2023 23:00:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30f2cf8ee5bf5c1f108724574b2965a0";
logging-data="3623277"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18MdJbC3X3nOspMfYCFJ+NrfaBA8cUqejA="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:jFGspyiNeMOurQIeKsK6/qaXOc0=
Content-Language: en-US
In-Reply-To: <uk0hdg$3ec6q$1@dont-email.me>
 by: Chris M. Thomasson - Sun, 26 Nov 2023 23:00 UTC

On 11/26/2023 2:38 PM, Chris M. Thomasson wrote:
> On 11/26/2023 11:27 AM, David Brown wrote:
>> On 26/11/2023 18:51, Bonita Montero wrote:
>>> Am 26.11.2023 um 16:28 schrieb David Brown:
>>>
>>>> No, exceptions do not make things easier - they make them /different/.
>>>
>>> Without exceptions you'd have to deal with return codes at each call
>>> level; this *is* much more work.
>>
>> As I said, anyone who claims their preference is always right, is wrong.
>>
>>>
>>>> Sometimes it might be helpful to move failure handling to a
>>>> different part of the code, sometimes it makes things harder.
>>>
>>> In C++ exceptions are mostly used for resource collapse situations, i.e.
>>> out of memory errors, network errors of filesystem failures.
>>
>> These are completely different situations.  /Sometimes/ exceptions are
>> a convenient way to handle network or filesystem issues.  They are
>> never a good way of handling out of memory errors, because out of
>> memory errors are caused by failures of the code, not external causes.
>
> Yup. One time I was experimenting with ways to allow a proxy server I
> was coding up to die before exhausting non-paged memory by artificially
> limiting the memory. This limit was used to make it go into a panic mode
> even though it has exhausted all of the non-paged memory. It just got
> too close. Iiic, it worked fairly well.
>
> A panic mode would make the server drop all "stale", timedout, ect,
> connections. It would also try to reclaim as much memory and resources
> as it could, without cancelling currently active and working connections...
>
> Basically, where you say:
> ________
> They are never a good way of handling out of memory errors
> ________
>
> Is true.
>
>
>
>>
>>> With that
>>> exceptions are the most convenient way to handle that. These types of
>>> errors are handled in most cases.
>>>
>>
>> Back here in the real world, most exceptions are /not/ handled -
>> programmers implementing the lower level functions think that
>> exceptions are someone else's problem and pass the buck up the line.
>> Programmers implementing the higher level parts don't know that the
>> lower level parts might through an exception - they assume functions
>> do what they claim to do.
>>
>> Used properly, exceptions can be helpful in some situations.
>> Unfortunately they are rarely used properly.
>>
>>>> Any code that sees a "bad_alloc" exception is already borked.
>>>
>>> With exceptions you can handle such situations in a clean way with
>>> a small effort.
>>>
>>
>> No, you can't.  You cannot magically make more memory appear, nor
>> magically fix the crappy code that caused a memory error in the first
>> place.  You are blindly buying into the myth.
>>
>>>> It is not failing because of the exception, it is failing because
>>>> of the bad programming.
>>>
>>> bad_alloc doesn't depend on the programming but rather how much memory
>>> you have. You might ignore bad_alloc for small allocations since they're
>>> unlikely to happen, but not for large allocations.
>>
>> If you are trying to make an allocation that is too big for the
>> system, you are doing things wrong.  Throwing an exception does not
>> help, because catching the exception cannot help.
>>
>>> I don't understand your attitude while programming with C++ because the
>>> runtime uses exceptions so much.
>>>
>>
>> The C++ code I use never throws exceptions.  I never have them
>> enabled. I don't miss them.
>>
>> (I don't use C++ for the kinds of uses where exceptions can be helpful.)
>>
>>
>>
>>
>

Man, I have not thought about this in a while. Wrt my proxy server, I
made it express itself where I could reap data on a so-called max and
min basis. The max would mean it used all non-paged memory and damn near
blue screened, wrt WinNT. The min means that it got close to gravely
hurting the system, but things still work...

Max: we can obtain this by allow the proxy server to crash itself, and
we are real time taking stats all the way down. We then take a look at
the data that caused it to crash...

Min: Divide certain parts of the data obtained from Max by say, two,
just for starters. So, for instance, we can say this many connections
crashed it wrt Max. Lets try to limit it to half of those. Then we run
the proxy server again with that artificial limit that denys new
connection attempts, and it does not exhaust all of the non-paged memory
at all. Then we try again by increacing the Min to to Max. Keep in mind
that if Min=Max, it will use all of the non-paged pool, and bring the
system to a fucking crawl...

Re: A Java- / .NET-like monitor

<uk0lb3$3er0k$1@dont-email.me>

  copy mid

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

  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: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 15:45:39 -0800
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uk0lb3$3er0k$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$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: Sun, 26 Nov 2023 23:45:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30f2cf8ee5bf5c1f108724574b2965a0";
logging-data="3632148"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19AWNe/efbNGbxqBNlUHYxJPvUHCyEdMB0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:TIof/bIO9+cOrsz756/VLv/F7jc=
Content-Language: en-US
In-Reply-To: <ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Sun, 26 Nov 2023 23:45 UTC

On 11/26/2023 2:35 AM, Bonita Montero wrote:
> Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:
>
>> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?
>
> If you want to wait mor than on the IOCP itself you could use WFMO
> and if the IOCP was signalled GQCS afterwards. With an IOCP you can
> wait only for the IOCP and maybe an alert if you use GQCSE.

Huh? This does not make sense to me at all. Have you ever used GQCS or
GQCSEX at all? Humm...

>
>> So your hack can break at any time? ...
>
> It would be nice if MS would document since when this works.

LOL! You are a character.

>
>> So your hack can break at any time? Keep in mind that I said GQCSEX...
>> :^) Its more efficient that GQCS. ...
>
> It's not about the efficiency but that you could be signalled other
> waitable kernel objects also.
>

Huh?

Re: A Java- / .NET-like monitor

<uk15kj$3knut$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.chmurka.net!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 05:23:48 +0100
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <uk15kj$3knut$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 27 Nov 2023 04:23:47 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="d317781494fe07ff2581ef843a582dff";
logging-data="3825629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gAH5DNipr0AaGc6naDWeSymM6E6IxzlE="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:0Yp63mAawNgWUDOHVI46SIJdd80=
Content-Language: de-DE
In-Reply-To: <uk067q$3ck1o$1@dont-email.me>
 by: Bonita Montero - Mon, 27 Nov 2023 04:23 UTC

Am 26.11.2023 um 20:27 schrieb David Brown:

> They are never a good way of handling out of memory errors, because
> out of memory errors are caused by failures of the code, not external
> causes.

These errors can happen depending on the type of application and
bad_alloc()s are a clean way to handle that. All other ways to
handle that like error codes are less convenient.

> Back here in the real world, most exceptions are /not/ handled - ...

You're talking about your applications and you think all peopl
do it like you do.

> No, you can't.  You cannot magically make more memory appear, ...

No one claims that for exceptions, but you can stop an operation
and recover from that with RAII and exceptions in a clean way.

> If you are trying to make an allocation that is too big for the system,
> you are doing things wrong. ...

This usually doesn't depend on the application but on the input
of a user.

> The C++ code I use never throws exceptions. ...

Then you must have dropped most parts of the standardy library.

Re: A Java- / .NET-like monitor

<uk15l9$3knut$2@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!rocksolid2!news.neodome.net!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 05:24:10 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <uk15l9$3knut$2@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
<uk0lb3$3er0k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 27 Nov 2023 04:24:09 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="d317781494fe07ff2581ef843a582dff";
logging-data="3825629"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++7shPECZpoBlfmOXaWnu6CFRuh5XvJx4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dizt6ukcoAw+3p995C18TzMnd6g=
Content-Language: de-DE
In-Reply-To: <uk0lb3$3er0k$1@dont-email.me>
 by: Bonita Montero - Mon, 27 Nov 2023 04:24 UTC

Am 27.11.2023 um 00:45 schrieb Chris M. Thomasson:
> On 11/26/2023 2:35 AM, Bonita Montero wrote:
>> Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:
>>
>>> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?
>>
>> If you want to wait mor than on the IOCP itself you could use WFMO
>> and if the IOCP was signalled GQCS afterwards. With an IOCP you can
>> wait only for the IOCP and maybe an alert if you use GQCSE.
>
> Huh? This does not make sense to me at all. Have you ever used GQCS or
> GQCSEX at all? Humm...

Idiot ...

>
>
>>
>>> So your hack can break at any time? ...
>>
>> It would be nice if MS would document since when this works.
>
> LOL! You are a character.
>
>>
>>> So your hack can break at any time? Keep in mind that I said
>>> GQCSEX... :^) Its more efficient that GQCS. ...
>>
>> It's not about the efficiency but that you could be signalled other
>> waitable kernel objects also.
>>
>
> Huh?

Re: A Java- / .NET-like monitor

<uk1cj3$3li7q$2@dont-email.me>

  copy mid

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

  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: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Sun, 26 Nov 2023 22:22:27 -0800
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <uk1cj3$3li7q$2@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
<uk0lb3$3er0k$1@dont-email.me>
<uk15l9$3knut$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: Mon, 27 Nov 2023 06:22:27 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30f2cf8ee5bf5c1f108724574b2965a0";
logging-data="3852538"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tCSbx21dpXkGp45tRZ7b1J1vXgF7oAdc="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:4++ADwGMmfDbvJlht67XvAmm6ps=
In-Reply-To: <uk15l9$3knut$2@raubtier-asyl.eternal-september.org>
Content-Language: en-US
 by: Chris M. Thomasson - Mon, 27 Nov 2023 06:22 UTC

On 11/26/2023 8:24 PM, Bonita Montero wrote:
> Am 27.11.2023 um 00:45 schrieb Chris M. Thomasson:
>> On 11/26/2023 2:35 AM, Bonita Montero wrote:
>>> Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:
>>>
>>>> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?
>>>
>>> If you want to wait mor than on the IOCP itself you could use WFMO
>>> and if the IOCP was signalled GQCS afterwards. With an IOCP you can
>>> wait only for the IOCP and maybe an alert if you use GQCSE.
>>
>> Huh? This does not make sense to me at all. Have you ever used GQCS or
>> GQCSEX at all? Humm...
>
> Idiot ...

You are the one that wants to pass a IOCP handle to WFMO, idoit!

I still don't think you know how GQCS and/or GQCSEX works.

>
>>
>>
>>>
>>>> So your hack can break at any time? ...
>>>
>>> It would be nice if MS would document since when this works.
>>
>> LOL! You are a character.
>>
>>>
>>>> So your hack can break at any time? Keep in mind that I said
>>>> GQCSEX... :^) Its more efficient that GQCS. ...
>>>
>>> It's not about the efficiency but that you could be signalled other
>>> waitable kernel objects also.
>>>
>>
>> Huh?
>

Re: A Java- / .NET-like monitor

<uk1i4n$3m9qq$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!rocksolid2!news.neodome.net!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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 08:57:12 +0100
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <uk1i4n$3m9qq$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
<uk0lb3$3er0k$1@dont-email.me>
<uk15l9$3knut$2@raubtier-asyl.eternal-september.org>
<uk1cj3$3li7q$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 27 Nov 2023 07:57:11 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="d317781494fe07ff2581ef843a582dff";
logging-data="3876698"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qgvrj1gmH1dCjjxL3SFG8wrAO2IO0lYQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:EoQy/hxuE0lOBl6D5TWNUtYRjBU=
In-Reply-To: <uk1cj3$3li7q$2@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Mon, 27 Nov 2023 07:57 UTC

Am 27.11.2023 um 07:22 schrieb Chris M. Thomasson:
> On 11/26/2023 8:24 PM, Bonita Montero wrote:
>> Am 27.11.2023 um 00:45 schrieb Chris M. Thomasson:
>>> On 11/26/2023 2:35 AM, Bonita Montero wrote:
>>>> Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:
>>>>
>>>>> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?
>>>>
>>>> If you want to wait mor than on the IOCP itself you could use WFMO
>>>> and if the IOCP was signalled GQCS afterwards. With an IOCP you can
>>>> wait only for the IOCP and maybe an alert if you use GQCSE.
>>>
>>> Huh? This does not make sense to me at all. Have you ever used GQCS
>>> or GQCSEX at all? Humm...
>>
>> Idiot ...
>
> You are the one that wants to pass a IOCP handle to WFMO, idoit!

I told you twice that this would make sense if you additionally would
wait for some other waitable kernel objects. If the IOCP is signalled
you'd do an additional GQCS() on the IOCP. This actually works with
Windows 11 and it would be nice if MS would document since which Win-
dows version it is safe to have a WFMO() on a IOCP.

> I still don't think you know how GQCS and/or GQCSEX works.

You don't understand what I write.

Re: A Java- / .NET-like monitor

<uk1jv5$3mhgq$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.hispagatos.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m.thomasson.1@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 00:28:21 -0800
Organization: A noiseless patient Spider
Lines: 50
Message-ID: <uk1jv5$3mhgq$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
<uk0lb3$3er0k$1@dont-email.me>
<uk15l9$3knut$2@raubtier-asyl.eternal-september.org>
<uk1cj3$3li7q$2@dont-email.me>
<uk1i4n$3m9qq$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, 27 Nov 2023 08:28:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30f2cf8ee5bf5c1f108724574b2965a0";
logging-data="3884570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ywOg8yHvQQGfDYfnPepovu0jqfRjfqa0="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:1nOVuVt5NLAHe1Lj8gUUqse962g=
Content-Language: en-US
In-Reply-To: <uk1i4n$3m9qq$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Mon, 27 Nov 2023 08:28 UTC

On 11/26/2023 11:57 PM, Bonita Montero wrote:
> Am 27.11.2023 um 07:22 schrieb Chris M. Thomasson:
>> On 11/26/2023 8:24 PM, Bonita Montero wrote:
>>> Am 27.11.2023 um 00:45 schrieb Chris M. Thomasson:
>>>> On 11/26/2023 2:35 AM, Bonita Montero wrote:
>>>>> Am 26.11.2023 um 00:06 schrieb Chris M. Thomasson:
>>>>>
>>>>>> Huh? Drill down on that. What do you mean wrt "_after_ you waited"?
>>>>>
>>>>> If you want to wait mor than on the IOCP itself you could use WFMO
>>>>> and if the IOCP was signalled GQCS afterwards. With an IOCP you can
>>>>> wait only for the IOCP and maybe an alert if you use GQCSE.
>>>>
>>>> Huh? This does not make sense to me at all. Have you ever used GQCS
>>>> or GQCSEX at all? Humm...
>>>
>>> Idiot ...
>>
>> You are the one that wants to pass a IOCP handle to WFMO, idoit!
>
> I told you twice that this would make sense if you additionally would
> wait for some other waitable kernel objects. If the IOCP is signalled
> you'd do an additional GQCS() on the IOCP. This actually works with
> Windows 11 and it would be nice if MS would document since which Win-
> dows version it is safe to have a WFMO() on a IOCP.

This is undocumented behavior, and I am not sure what benefit it would
have anyway. Iirc, WFMO does not have to be atomic in the way it waits
on the HANDLE's. It can be broken down into multiple WFSO's.

>> I still don't think you know how GQCS and/or GQCSEX works.
>
> You don't understand what I write.

Whatever you say. Take note of:

https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects
________________
When bWaitAll is TRUE, the function's wait operation is completed only
when the states of all objects have been set to signaled. The function
does not modify the states of the specified objects until the states of
all objects have been set to signaled. For example, a mutex can be
signaled, but the thread does not get ownership until the states of the
other objects are also set to signaled. In the meantime, some other
thread may get ownership of the mutex, thereby setting its state to
nonsignaled.
________________

Re: A Java- / .NET-like monitor

<uk1kah$3mkqg$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 09:34:26 +0100
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <uk1kah$3mkqg$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<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>
<ujgeu8$evq1$1@dont-email.me>
<ujht1s$p85k$1@raubtier-asyl.eternal-september.org>
<ujpctk$27892$2@dont-email.me>
<ujpkul$28aoq$2@raubtier-asyl.eternal-september.org>
<ujpq0f$28srl$6@dont-email.me>
<ujqotn$2dtfl$1@raubtier-asyl.eternal-september.org>
<ujrce8$2gjhg$4@dont-email.me>
<ujsnr8$2prnc$1@raubtier-asyl.eternal-september.org>
<ujtuku$2v76e$5@dont-email.me>
<ujv727$37tp2$1@raubtier-asyl.eternal-september.org>
<uk0lb3$3er0k$1@dont-email.me>
<uk15l9$3knut$2@raubtier-asyl.eternal-september.org>
<uk1cj3$3li7q$2@dont-email.me>
<uk1i4n$3m9qq$1@raubtier-asyl.eternal-september.org>
<uk1jv5$3mhgq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 27 Nov 2023 08:34:25 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="d317781494fe07ff2581ef843a582dff";
logging-data="3887952"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DpDoY1RmlMFyPMH8fT3uy6ibT9ZBgqHk="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:VlKxVlTm8Fz6JiP9xkv+Ozj6S1Y=
Content-Language: de-DE
In-Reply-To: <uk1jv5$3mhgq$1@dont-email.me>
 by: Bonita Montero - Mon, 27 Nov 2023 08:34 UTC

Am 27.11.2023 um 09:28 schrieb Chris M. Thomasson:

> On 11/26/2023 11:57 PM, Bonita Montero wrote:

>> I told you twice that this would make sense if you additionally would
>> wait for some other waitable kernel objects. If the IOCP is signalled
>> you'd do an additional GQCS() on the IOCP. This actually works with
>> Windows 11 and it would be nice if MS would document since which Win-
>> dows version it is safe to have a WFMO() on a IOCP.

> This is undocumented behavior, and I am not sure what benefit it would
> have anyway. ...

If you can imagine the benefit of waiting for multiple kernel objects
you can also imagine the benefit of waiting multiple kernel objects
where at least one object is an IOCP.

> https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects
> ________________
> When bWaitAll is TRUE, the function's wait operation is completed only
> when the states of all objects have been set to signaled. The function
> does not modify the states of the specified objects until the states of
> all objects have been set to signaled. For example, a mutex can be
> signaled, but the thread does not get ownership until the states of the
> other objects are also set to signaled. In the meantime, some other
> thread may get ownership of the mutex, thereby setting its state to
> nonsignaled.
> ________________

You can probably just as easily imagine that I don't mean the case
where we wait for all objects to signal, but only one of them. So
I don't understand why you're so misunderstanding what I said.

Re: A Java- / .NET-like monitor

<uk1o1s$3n832$1@dont-email.me>

  copy mid

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

  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: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 10:38:04 +0100
Organization: A noiseless patient Spider
Lines: 83
Message-ID: <uk1o1s$3n832$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me>
<uk15kj$3knut$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 27 Nov 2023 09:38:04 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5704c807c812aff9ba3a6d376398dc26";
logging-data="3907682"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+Qdc8Jy+anwxoS8NTtDCog2jGJKBf2CYE="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:yvDX9Yd8AZ8Wi0u1AuZnMaQSv8o=
In-Reply-To: <uk15kj$3knut$1@raubtier-asyl.eternal-september.org>
Content-Language: en-GB
 by: David Brown - Mon, 27 Nov 2023 09:38 UTC

On 27/11/2023 05:23, Bonita Montero wrote:
> Am 26.11.2023 um 20:27 schrieb David Brown:
>
>> They are never a good way of handling out of memory errors, because
>> out of memory errors  are caused by failures of the code, not external
>> causes.
>
> These errors can happen depending on the type of application and
> bad_alloc()s are a clean way to handle that. All other ways to
> handle that like error codes are less convenient.

Out of memory failures are /never/ clean. A program that tries to get
more memory than is available, using standard allocators, is broken.

I am not saying that the alternative to bad_alloc exceptions is error
codes for memory failures - I am saying that the alternative is not
having memory allocation failures during normal operations.

>
>> Back here in the real world, most exceptions are /not/ handled - ...
>
> You're talking about your applications and you think all peopl
> do it like you do.

No, I am talking about reality. /I/ don't use exceptions in C++. They
are not enabled in my builds. How exceptions are handled is a
meaningless question for my own code.

It is extremely difficult to write truly exception-safe code, where the
code will work correctly in the face of unexpected exceptions happening
from pretty much any function call. It is possible for some kinds of
code, when developers have enough knowledge and experience, and are able
to spend enough time and effort on it. But that is a small minority.

Oh, and the exception handling is almost always untested - or at least,
far from comprehensively tested.

That does not mean that exceptions are always bad - they can be a useful
way to handle some issues. And it does not mean that error codes or
other solutions are always good - most error-handling code of any sort
is untested. It means they are a tool that should be understood and
used when appropriate, but they should not be over-estimated as you do.

(If C++ exceptions were as perfect as you imagine, why do you think
there is such a strong pressure in the C++ standards and development
groups to move towards things like "zero-overhead deterministic
exceptions" ? Why do we have std::expected<> in C++23?)

>
>> No, you can't.  You cannot magically make more memory appear, ...
>
> No one claims that for exceptions, but you can stop an operation
> and recover from that with RAII and exceptions in a clean way.
>

Keep telling yourself that. You won't persuade others, but maybe you'll
feel happier.

>> If you are trying to make an allocation that is too big for the
>> system, you are doing things wrong. ...
>
> This usually doesn't depend on the application but on the input
> of a user.
>

An application that does not check the input from the user is doing
things wrong.

>> The C++ code I use never throws exceptions. ...
>
> Then you must have dropped most parts of the standardy library.
>

Of course I have. It is useless for the work I do.

That doesn't mean it is useless for other people and other types of
coding, of course.

Actually, most of the standard library uses exceptions only very rarely,
and in many of these cases the only possible exception is for memory
allocation failure - which should only occur if your program is badly
borked.

Re: A Java- / .NET-like monitor

<uk1p35$3nbhb$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  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.Montero@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 10:55:50 +0100
Organization: A noiseless patient Spider
Lines: 41
Message-ID: <uk1p35$3nbhb$1@raubtier-asyl.eternal-september.org>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me>
<uk15kj$3knut$1@raubtier-asyl.eternal-september.org>
<uk1o1s$3n832$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 27 Nov 2023 09:55:49 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="d317781494fe07ff2581ef843a582dff";
logging-data="3911211"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4xmgOEsvqd9CbbsFXrvV9To1/4+YLkQI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:U5U4Vyu3eGZmkIc5bADIODwvsl4=
In-Reply-To: <uk1o1s$3n832$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Mon, 27 Nov 2023 09:55 UTC

Am 27.11.2023 um 10:38 schrieb David Brown:

> Out of memory failures are /never/ clean.  A program that tries to get
> more memory than is available, using standard allocators, is broken.

No, usually that depends on the input and this is a valid situation for
most applications.

> I am not saying that the alternative to bad_alloc exceptions is error
> codes for memory failures - I am saying that the alternative is not
> having memory allocation failures during normal operations.

That may be true for a lot of applications, but it doesn't hurt to
handle that and for applications which may require a lot of memory
- depending on the input - this is absolutely necessary.

> No, I am talking about reality.  /I/ don't use exceptions in C++.
> They are not enabled in my builds.  How exceptions are handled is
> a meaningless question for my own code.

The standard library would simply terminate if exceptions support is
disabled because there is no unwinding code for the caller, that's
un-clean.

> It is extremely difficult to write truly exception-safe code, ...

Absolutely not if you use RAII consequently.

> An application that does not check the input from the user is doing
> things wrong.

The application itself can't decide that, it's part of the memory
management which says if there's enough memory or not, partitially
depending on the kernel, partitially depending on the user-space
pooling. The application below that can't do that.

> Of course I have.  It is useless for the work I do.

And you think it's useless for everyone by saying that handling
bad_alloc doesn't usually make sense.

Re: A Java- / .NET-like monitor

<uk1qfb$3nimb$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!news.neodome.net!news.nntp4.net!news.gegeweb.eu!gegeweb.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: david.brown@hesbynett.no (David Brown)
Newsgroups: comp.lang.c++
Subject: Re: A Java- / .NET-like monitor
Date: Mon, 27 Nov 2023 11:19:23 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <uk1qfb$3nimb$1@dont-email.me>
References: <uig7jl$1l4v0$1@raubtier-asyl.eternal-september.org>
<CS66N.35203$cAm7.7747@fx18.iad> <Tb86N.7506$xeV4.1209@fx45.iad>
<20231118122549.392@kylheku.com> <20231124011442.00004937@yahoo.com>
<ujpcnq$27892$1@dont-email.me>
<ujpl4m$28aoq$4@raubtier-asyl.eternal-september.org>
<ujppo2$28srl$5@dont-email.me> <bL38N.65219$cAm7.33028@fx18.iad>
<20231124102842.71@kylheku.com>
<ujsobk$2ps2p$1@raubtier-asyl.eternal-september.org>
<20231125100947.641@kylheku.com> <%Wr8N.40010$zh16.35086@fx48.iad>
<20231126012940.00001397@yahoo.com> <ujvf5l$3934n$1@dont-email.me>
<ujvhph$39dt7$1@raubtier-asyl.eternal-september.org>
<ujvo70$3adcv$1@dont-email.me>
<uk00ih$3bl9e$1@raubtier-asyl.eternal-september.org>
<uk067q$3ck1o$1@dont-email.me>
<uk15kj$3knut$1@raubtier-asyl.eternal-september.org>
<uk1o1s$3n832$1@dont-email.me>
<uk1p35$3nbhb$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 27 Nov 2023 10:19:23 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="5704c807c812aff9ba3a6d376398dc26";
logging-data="3918539"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19z5C2WUboPucwyAk+EPHMWRt7reLsiuGA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:ohS4q+v0mlR7ZZcFDLaxWXOc5LQ=
In-Reply-To: <uk1p35$3nbhb$1@raubtier-asyl.eternal-september.org>
Content-Language: en-GB
 by: David Brown - Mon, 27 Nov 2023 10:19 UTC

On 27/11/2023 10:55, Bonita Montero wrote:
> Am 27.11.2023 um 10:38 schrieb David Brown:

>> Of course I have.  It is useless for the work I do.
>
> And you think it's useless for everyone by saying that handling
> bad_alloc doesn't usually make sense.
>

No, I said that most of the standard library is useless for the work I
do, but useful for other people. And I've said that exceptions can be
useful (but not for my work), but are not the kind of wonderful
universal "clean" failure handling mechanism you seem to believe.

The way you move the goalposts around, fail to read posts, and fail to
address questions, makes it clear that you prefer cultish believe to
learning and thinking. And since you don't want to learn or think,
there is little point in discussing with you.


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

Pages:1234567891011
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor