Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

In Nature there are neither rewards nor punishments, there are consequences. -- R. G. Ingersoll


devel / comp.lang.c++ / Re: Idea for spin-wait loops

SubjectAuthor
* Idea for spin-wait loopsBonita Montero
`* Re: Idea for spin-wait loopsChris M. Thomasson
 +* Re: Idea for spin-wait loopsChris M. Thomasson
 |`* Re: Idea for spin-wait loopsBonita Montero
 | `* Re: Idea for spin-wait loopsChris M. Thomasson
 |  `* Re: Idea for spin-wait loopsBonita Montero
 |   `* Re: Idea for spin-wait loopsChris M. Thomasson
 |    +* Re: Idea for spin-wait loopsBonita Montero
 |    |`* Re: Idea for spin-wait loopsChris M. Thomasson
 |    | +- Re: Idea for spin-wait loopsChris M. Thomasson
 |    | `- Re: Idea for spin-wait loopsBonita Montero
 |    `* Re: Idea for spin-wait loopsMichael S
 |     `- Re: Idea for spin-wait loopsChris M. Thomasson
 +* Re: Idea for spin-wait loopsBonita Montero
 |`- Re: Idea for spin-wait loopsChris M. Thomasson
 `* Re: Idea for spin-wait loopsScott Lurndal
  +- Re: Idea for spin-wait loopsBonita Montero
  `* Re: Idea for spin-wait loopsMichael S
   +- Re: Idea for spin-wait loopsMichael S
   `* Re: Idea for spin-wait loopsBonita Montero
    `- Re: Idea for spin-wait loopsChris M. Thomasson

1
Idea for spin-wait loops

<utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!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.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Idea for spin-wait loops
Date: Sat, 23 Mar 2024 17:53:40 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <utn1eh$3oeks$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: Sat, 23 Mar 2024 16:53:37 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="2059e4cb17b0cfa4536c7b2f5d738773";
logging-data="3947164"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/n8vw1aNAXcrRqdL99/yjY74KALabGxBM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oyp5GZwEx15rxtvxzHqmSf+MVd8=
Content-Language: de-DE
 by: Bonita Montero - Sat, 23 Mar 2024 16:53 UTC

I've got a nice idea for a new processor-extrension for spin-wait
-loops. The idea is that a thread of a processors enters a sleep
state if a word in memory is equal to a certain register until
the cacheline containing the word is modified or there's a timeout
according to the timestamp-counter's value.
This would eliminate active spinning and polling a value in memory.
Polling would occur only if the cacheline would be modified by
another thread.

Re: Idea for spin-wait loops

<utnff2$3rn1f$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Sat, 23 Mar 2024 13:52:49 -0700
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <utnff2$3rn1f$1@dont-email.me>
References: <utn1eh$3oeks$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: Sat, 23 Mar 2024 20:52:50 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="136108bc033d63220533a114254bf648";
logging-data="4054063"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jyQX3/1q31JSLP3CpC1N4wao8H/qe6z8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:7ZH4SyimXdnpOsd3rQFXRZEmdMs=
Content-Language: en-US
In-Reply-To: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Sat, 23 Mar 2024 20:52 UTC

On 3/23/2024 9:53 AM, Bonita Montero wrote:
> I've got a nice idea for a new processor-extrension for spin-wait
> -loops. The idea is that a thread of a processors enters a sleep
> state if a word in memory is equal to a certain register until
> the cacheline containing the word is modified or there's a timeout
> according to the timestamp-counter's value.
> This would eliminate active spinning and polling a value in memory.
> Polling would occur only if the cacheline would be modified by
> another thread.

futex

Re: Idea for spin-wait loops

<utnfoq$3s1eu$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Sat, 23 Mar 2024 13:58:02 -0700
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <utnfoq$3s1eu$1@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 23 Mar 2024 20:58:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="136108bc033d63220533a114254bf648";
logging-data="4064734"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fDYxiblawG+YCM+K05i/PADfQa+LlGuU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/naXwye/TWKL5P36kZJkjaPTlIo=
In-Reply-To: <utnff2$3rn1f$1@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Sat, 23 Mar 2024 20:58 UTC

On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>> I've got a nice idea for a new processor-extrension for spin-wait
>> -loops. The idea is that a thread of a processors enters a sleep
>> state if a word in memory is equal to a certain register until
>> the cacheline containing the word is modified or there's a timeout
>> according to the timestamp-counter's value.
>> This would eliminate active spinning and polling a value in memory.
>> Polling would occur only if the cacheline would be modified by
>> another thread.
>
> futex

MWAIT?

Re: Idea for spin-wait loops

<utohnb$6p4u$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Sun, 24 Mar 2024 07:37:33 +0100
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <utohnb$6p4u$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 24 Mar 2024 06:37:31 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="661bbc650b0e553e73b14b7d466277cb";
logging-data="222366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+W9iIA50SymJqCgBd6PPN2lcXPZkV+cxw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:E53TvgV/SS5+/E/1LEPL/GcF3oE=
Content-Language: de-DE
In-Reply-To: <utnff2$3rn1f$1@dont-email.me>
 by: Bonita Montero - Sun, 24 Mar 2024 06:37 UTC

Am 23.03.2024 um 21:52 schrieb Chris M. Thomasson:
> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>> I've got a nice idea for a new processor-extrension for spin-wait
>> -loops. The idea is that a thread of a processors enters a sleep
>> state if a word in memory is equal to a certain register until
>> the cacheline containing the word is modified or there's a timeout
>> according to the timestamp-counter's value.
>> This would eliminate active spinning and polling a value in memory.
>> Polling would occur only if the cacheline would be modified by
>> another thread.
>
> futex

Not all kinds of mutexes can be done with a futex.

Re: Idea for spin-wait loops

<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Sun, 24 Mar 2024 07:38:02 +0100
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 24 Mar 2024 06:38:01 -0000 (UTC)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="661bbc650b0e553e73b14b7d466277cb";
logging-data="222366"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/K4BjdclK73404yk6VF8Rs1ZUYQLOKRlw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:sNf3FIgN8+05OVisR/6NsSV9vtg=
In-Reply-To: <utnfoq$3s1eu$1@dont-email.me>
Content-Language: de-DE
 by: Bonita Montero - Sun, 24 Mar 2024 06:38 UTC

Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>> I've got a nice idea for a new processor-extrension for spin-wait
>>> -loops. The idea is that a thread of a processors enters a sleep
>>> state if a word in memory is equal to a certain register until
>>> the cacheline containing the word is modified or there's a timeout
>>> according to the timestamp-counter's value.
>>> This would eliminate active spinning and polling a value in memory.
>>> Polling would occur only if the cacheline would be modified by
>>> another thread.
>>
>> futex
>
> MWAIT?

MWAIT has no timeout.

Re: Idea for spin-wait loops

<utpv6m$hvrl$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Sun, 24 Mar 2024 12:33:42 -0700
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <utpv6m$hvrl$1@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
<utohnb$6p4u$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, 24 Mar 2024 19:33:43 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d025a76bd6d95d530e804f50fadb4211";
logging-data="589685"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19KAtNVUpAgEjq2Nd+IeltBkUXJu0WtlVI="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:DkrPK9vwW56n8dGuNwjP1pWezo8=
Content-Language: en-US
In-Reply-To: <utohnb$6p4u$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Sun, 24 Mar 2024 19:33 UTC

On 3/23/2024 11:37 PM, Bonita Montero wrote:
> Am 23.03.2024 um 21:52 schrieb Chris M. Thomasson:
>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>> I've got a nice idea for a new processor-extrension for spin-wait
>>> -loops. The idea is that a thread of a processors enters a sleep
>>> state if a word in memory is equal to a certain register until
>>> the cacheline containing the word is modified or there's a timeout
>>> according to the timestamp-counter's value.
>>> This would eliminate active spinning and polling a value in memory.
>>> Polling would occur only if the cacheline would be modified by
>>> another thread.
>>
>> futex
>
> Not all kinds of mutexes can be done with a futex.
>

Have you ever heard of an asymmetric mutex?

Re: Idea for spin-wait loops

<Zf0MN.450378$yEgf.411259@fx09.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx09.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Idea for spin-wait loops
Newsgroups: comp.lang.c++
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org> <utnff2$3rn1f$1@dont-email.me>
Lines: 16
Message-ID: <Zf0MN.450378$yEgf.411259@fx09.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Sun, 24 Mar 2024 20:43:37 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Sun, 24 Mar 2024 20:43:37 GMT
X-Received-Bytes: 1438
 by: Scott Lurndal - Sun, 24 Mar 2024 20:43 UTC

"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
>On 3/23/2024 9:53 AM, Bonita Montero wrote:
>> I've got a nice idea for a new processor-extrension for spin-wait
>> -loops. The idea is that a thread of a processors enters a sleep
>> state if a word in memory is equal to a certain register until

A processor which is doesn't own (or have a shared copy) of the
cacheline which would contain that word in memory will never know
if it was modified, as it won't see the invalidate messages in
a directory-based cache subsystem (leaving aside noncachable
accesses to the word in memory, of course).

This sounds like a solution to a problem that doesn't exist,
and there would be no incentive for a processor designer
to include the substantial additional complexity required
to support your feature.

Re: Idea for spin-wait loops

<utr58g$u29g$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Mon, 25 Mar 2024 07:23:14 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <utr58g$u29g$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <Zf0MN.450378$yEgf.411259@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 07:23:12 +0100
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="f682ab53868172c4bf5d80b8f1939b9f";
logging-data="985392"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4S3Pqfn0FwyANoF9LuM4hujmCYvTVu+o="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:vZXAbb1vC+GOo6Q0fOqGho0H2YI=
In-Reply-To: <Zf0MN.450378$yEgf.411259@fx09.iad>
Content-Language: de-DE
 by: Bonita Montero - Mon, 25 Mar 2024 06:23 UTC

Am 24.03.2024 um 21:43 schrieb Scott Lurndal:

> This sounds like a solution to a problem that doesn't exist,
> and there would be no incentive for a processor designer
> to include the substantial additional complexity required
> to support your feature.

MONITOR / MWAIT is nearly the same except for the timeout.

Re: Idea for spin-wait loops

<20240325153450.000019cf@yahoo.com>

  copy mid

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

  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: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Mon, 25 Mar 2024 14:34:50 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <20240325153450.000019cf@yahoo.com>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
<Zf0MN.450378$yEgf.411259@fx09.iad>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 13:35:00 +0100 (CET)
Injection-Info: dont-email.me; posting-host="ff58747de83365f3f96c18f69047f6c9";
logging-data="1155735"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ssK1+PidTfuS2vz6FnP2Ua+LxpcM/A60="
Cancel-Lock: sha1:sohszQrOA+l+rGsmXKyUEXBQea8=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Mon, 25 Mar 2024 12:34 UTC

On Sun, 24 Mar 2024 20:43:37 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:

> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
> >On 3/23/2024 9:53 AM, Bonita Montero wrote:
> >> I've got a nice idea for a new processor-extrension for spin-wait
> >> -loops. The idea is that a thread of a processors enters a sleep
> >> state if a word in memory is equal to a certain register until
>
> A processor which is doesn't own (or have a shared copy) of the
> cacheline which would contain that word in memory will never know
> if it was modified, as it won't see the invalidate messages in
> a directory-based cache subsystem (leaving aside noncachable
> accesses to the word in memory, of course).
>

It seems, I didn't understand the idea.
Of course, the waiting thread/core has the word in question in its
L1D cache when it enters the wait loop.
Of course, it is awaken if/when the the word is evicted from the cache
for unrelated reason, i.e. practically because of capacity conflict
caused by activity of other threads that are running on the same
core. There is nothing wrong with spurious awakenings as long as they
are rare.

> This sounds like a solution to a problem that doesn't exist,
> and there would be no incentive for a processor designer
> to include the substantial additional complexity required
> to support your feature.

The problem does exist and primitive proposed by Bonita is not new. It
is a minor modification of Monitor/Mwait.
For current Intel and AMD processors this sort of things is
relatively unattractive because at 2 threads per core and with rather
measurable throughput gains achieved by running 2 threads instead of
one (for AMD up to 30%, for Intel a little less, but often measurable),
each thread is a valuable resource, so you don't really want to keep it
paused for too long time. And the whole point of Bonita's amendment of
existing mechanism is that the software has more control on long waits.

On IBM POWER and on few of Sun/Oracle chips they have up to 8 threads
per core, so each thread is not that valuable. It means that longer
uninterrupted wait has more sense and control of duration of the
timeout is more desirable. But may be IBM's and Oracle's variants of
MWAIT already have it?

Re: Idea for spin-wait loops

<20240325201122.000031d6@yahoo.com>

  copy mid

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

  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: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Mon, 25 Mar 2024 19:11:22 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <20240325201122.000031d6@yahoo.com>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
<Zf0MN.450378$yEgf.411259@fx09.iad>
<20240325153450.000019cf@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 18:11:32 +0100 (CET)
Injection-Info: dont-email.me; posting-host="ff58747de83365f3f96c18f69047f6c9";
logging-data="1264193"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181zMXvC9U5XiiYwAt7nnAcbMs4HcnMW2A="
Cancel-Lock: sha1:UpoGlJBKHFv0NTuCcA+ly+CX5Zo=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Mon, 25 Mar 2024 17:11 UTC

On Mon, 25 Mar 2024 14:34:50 +0200
Michael S <already5chosen@yahoo.com> wrote:

> On Sun, 24 Mar 2024 20:43:37 GMT
> scott@slp53.sl.home (Scott Lurndal) wrote:
>
> > "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
> > >On 3/23/2024 9:53 AM, Bonita Montero wrote:
> > >> I've got a nice idea for a new processor-extrension for spin-wait
> > >> -loops. The idea is that a thread of a processors enters a sleep
> > >> state if a word in memory is equal to a certain register until
> > >>
> >
> > A processor which is doesn't own (or have a shared copy) of the
> > cacheline which would contain that word in memory will never know
> > if it was modified, as it won't see the invalidate messages in
> > a directory-based cache subsystem (leaving aside noncachable
> > accesses to the word in memory, of course).
> >
>
> It seems, I didn't understand the idea.

I meant to say 'you' instead of 'I'.

Re: Idea for spin-wait loops

<utsdnc$17sr6$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Mon, 25 Mar 2024 18:53:52 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <utsdnc$17sr6$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <Zf0MN.450378$yEgf.411259@fx09.iad>
<20240325153450.000019cf@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 25 Mar 2024 18:53:48 +0100 (CET)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="f682ab53868172c4bf5d80b8f1939b9f";
logging-data="1307494"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+V5E4VMbrtTiGykAUdVlz5kxrBADM++YM="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:wQpAOS/REpkiwjclQNb7pWvj4PA=
Content-Language: de-DE
In-Reply-To: <20240325153450.000019cf@yahoo.com>
 by: Bonita Montero - Mon, 25 Mar 2024 17:53 UTC

Am 25.03.2024 um 13:34 schrieb Michael S:

> The problem does exist and primitive proposed by Bonita is not new.
> It is a minor modification of Monitor/Mwait.

Functionally the modification is minor, but the effect would be
major since the cache-interconnect traffic would be minimized.

Re: Idea for spin-wait loops

<uttd1r$1ervd$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Mon, 25 Mar 2024 19:48:27 -0700
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <uttd1r$1ervd$1@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$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: Tue, 26 Mar 2024 03:48:28 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d66ad16170de83b3a5d283096306324c";
logging-data="1535981"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JkcU88akMuSNM6PxznQ+XE2Xl5D9S3Qg="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rhNQMKJzFou00Rp3ampoH04r13A=
In-Reply-To: <utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 26 Mar 2024 02:48 UTC

On 3/23/2024 11:38 PM, Bonita Montero wrote:
> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>> state if a word in memory is equal to a certain register until
>>>> the cacheline containing the word is modified or there's a timeout
>>>> according to the timestamp-counter's value.
>>>> This would eliminate active spinning and polling a value in memory.
>>>> Polling would occur only if the cacheline would be modified by
>>>> another thread.
>>>
>>> futex
>>
>> MWAIT?
>
> MWAIT has no timeout.
>

Not sure how important it would be for MWAIT to have a timeout... You
are referring to user space, right?

Re: Idea for spin-wait loops

<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 11:12:07 +0100
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Mar 2024 11:12:03 +0100 (CET)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="079523d1c5ad3329c9e7ca600fad9226";
logging-data="1847080"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19oFfFgZyZeqKA1cnGZcjpsvhuieIqlXDY="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:RZlO52crMB1z0B2VD+ZIm7iUF7Y=
Content-Language: de-DE
In-Reply-To: <uttd1r$1ervd$1@dont-email.me>
 by: Bonita Montero - Tue, 26 Mar 2024 10:12 UTC

Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>>> state if a word in memory is equal to a certain register until
>>>>> the cacheline containing the word is modified or there's a timeout
>>>>> according to the timestamp-counter's value.
>>>>> This would eliminate active spinning and polling a value in memory.
>>>>> Polling would occur only if the cacheline would be modified by
>>>>> another thread.
>>>>
>>>> futex
>>>
>>> MWAIT?
>>
>> MWAIT has no timeout.
>>
>
> Not sure how important it would be for MWAIT to have a timeout... You
> are referring to user space, right?

MWAIT could be used for limited spinning like glibc's pthread_mutex
is capable. The advantage of a MWAIT with timout would be much less
interconnect-traffic compared to polling.

Re: Idea for spin-wait loops

<utv9l7$2anr0$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 13:02:47 -0700
Organization: A noiseless patient Spider
Lines: 31
Message-ID: <utv9l7$2anr0$2@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$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: Tue, 26 Mar 2024 20:02:48 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d66ad16170de83b3a5d283096306324c";
logging-data="2449248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LkbuUrQ+6tJmObx7bf+UhqBjaa0t4OQQ="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:mECma6aryIlArPQpFz1xswyb+DI=
Content-Language: en-US
In-Reply-To: <utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Tue, 26 Mar 2024 20:02 UTC

On 3/26/2024 3:12 AM, Bonita Montero wrote:
> Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
>> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>>>> state if a word in memory is equal to a certain register until
>>>>>> the cacheline containing the word is modified or there's a timeout
>>>>>> according to the timestamp-counter's value.
>>>>>> This would eliminate active spinning and polling a value in memory.
>>>>>> Polling would occur only if the cacheline would be modified by
>>>>>> another thread.
>>>>>
>>>>> futex
>>>>
>>>> MWAIT?
>>>
>>> MWAIT has no timeout.
>>>
>>
>> Not sure how important it would be for MWAIT to have a timeout... You
>> are referring to user space, right?
>
> MWAIT could be used for limited spinning like glibc's pthread_mutex
> is capable. The advantage of a MWAIT with timout would be much less
> interconnect-traffic compared to polling.
>

MWAIT is meant to get around polling?

Re: Idea for spin-wait loops

<utvaa6$2anr0$4@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 13:13:58 -0700
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <utvaa6$2anr0$4@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <Zf0MN.450378$yEgf.411259@fx09.iad>
<20240325153450.000019cf@yahoo.com>
<utsdnc$17sr6$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: Tue, 26 Mar 2024 20:13:58 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d66ad16170de83b3a5d283096306324c";
logging-data="2449248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19msMtnSWSXxcGyJ6wGXHu7RvJ7E2Zbxgs="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ftPhk6bbsnAVfV1/E0sQSIhrRdo=
Content-Language: en-US
In-Reply-To: <utsdnc$17sr6$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Tue, 26 Mar 2024 20:13 UTC

On 3/25/2024 10:53 AM, Bonita Montero wrote:
> Am 25.03.2024 um 13:34 schrieb Michael S:
>
>> The problem does exist and primitive proposed by Bonita is not new.
>> It is a minor modification of Monitor/Mwait.
>
> Functionally the modification is minor, but the effect would be
> major since the cache-interconnect traffic would be minimized.
>

Ask over in comp.arch

Re: Idea for spin-wait loops

<utvar6$2b6dl$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 21:23:07 +0100
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <utvar6$2b6dl$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Mar 2024 20:23:03 +0100 (CET)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="079523d1c5ad3329c9e7ca600fad9226";
logging-data="2464181"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wCvoYn02kmPYQPUbGKagGLCyRUr6fxV8="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ordoeZ17DeLCkOBe7MxyVz3zDrA=
Content-Language: de-DE
In-Reply-To: <utv9l7$2anr0$2@dont-email.me>
 by: Bonita Montero - Tue, 26 Mar 2024 20:23 UTC

Am 26.03.2024 um 21:02 schrieb Chris M. Thomasson:
> On 3/26/2024 3:12 AM, Bonita Montero wrote:
>> Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
>>> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>>>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>>>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>>>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>>>>> state if a word in memory is equal to a certain register until
>>>>>>> the cacheline containing the word is modified or there's a timeout
>>>>>>> according to the timestamp-counter's value.
>>>>>>> This would eliminate active spinning and polling a value in memory.
>>>>>>> Polling would occur only if the cacheline would be modified by
>>>>>>> another thread.
>>>>>>
>>>>>> futex
>>>>>
>>>>> MWAIT?
>>>>
>>>> MWAIT has no timeout.
>>>>
>>>
>>> Not sure how important it would be for MWAIT to have a timeout... You
>>> are referring to user space, right?
>>
>> MWAIT could be used for limited spinning like glibc's pthread_mutex
>> is capable. The advantage of a MWAIT with timout would be much less
>> interconnect-traffic compared to polling.
>>
>
> MWAIT is meant to get around polling?

MWAIT could replace polling / spinning on a mutex for a limited
time if it would have a timeout.

Re: Idea for spin-wait loops

<utvb9l$2anr0$6@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 13:30:45 -0700
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <utvb9l$2anr0$6@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me>
<utvar6$2b6dl$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: Tue, 26 Mar 2024 20:30:46 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d66ad16170de83b3a5d283096306324c";
logging-data="2449248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+tuOxzHCitZExbYmZF2AlsGK5OMqO3JoU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:RpsVUiKmWblirEtuehh6Sm59GlE=
Content-Language: en-US
In-Reply-To: <utvar6$2b6dl$1@raubtier-asyl.eternal-september.org>
 by: Chris M. Thomasson - Tue, 26 Mar 2024 20:30 UTC

On 3/26/2024 1:23 PM, Bonita Montero wrote:
> Am 26.03.2024 um 21:02 schrieb Chris M. Thomasson:
>> On 3/26/2024 3:12 AM, Bonita Montero wrote:
>>> Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
>>>> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>>>>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>>>>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>>>>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>>>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>>>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>>>>>> state if a word in memory is equal to a certain register until
>>>>>>>> the cacheline containing the word is modified or there's a timeout
>>>>>>>> according to the timestamp-counter's value.
>>>>>>>> This would eliminate active spinning and polling a value in memory.
>>>>>>>> Polling would occur only if the cacheline would be modified by
>>>>>>>> another thread.
>>>>>>>
>>>>>>> futex
>>>>>>
>>>>>> MWAIT?
>>>>>
>>>>> MWAIT has no timeout.
>>>>>
>>>>
>>>> Not sure how important it would be for MWAIT to have a timeout...
>>>> You are referring to user space, right?
>>>
>>> MWAIT could be used for limited spinning like glibc's pthread_mutex
>>> is capable. The advantage of a MWAIT with timout would be much less
>>> interconnect-traffic compared to polling.
>>>
>>
>> MWAIT is meant to get around polling?
>
> MWAIT could replace polling / spinning on a mutex for a limited
> time if it would have a timeout.
>

So, you timeout, check some other stuff, then wait again. Still sounds
like polling?

Re: Idea for spin-wait loops

<utvbas$2anr0$7@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Tue, 26 Mar 2024 13:31:24 -0700
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <utvbas$2anr0$7@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me>
<utvar6$2b6dl$1@raubtier-asyl.eternal-september.org>
<utvb9l$2anr0$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 26 Mar 2024 20:31:24 +0100 (CET)
Injection-Info: dont-email.me; posting-host="d66ad16170de83b3a5d283096306324c";
logging-data="2449248"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/cYPxMaIC7uEkmFQ4kkY2iT6PmmZ3A3BU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:E212AfQTu0EUTXFT/xLD0USFjME=
In-Reply-To: <utvb9l$2anr0$6@dont-email.me>
Content-Language: en-US
 by: Chris M. Thomasson - Tue, 26 Mar 2024 20:31 UTC

On 3/26/2024 1:30 PM, Chris M. Thomasson wrote:
> On 3/26/2024 1:23 PM, Bonita Montero wrote:
>> Am 26.03.2024 um 21:02 schrieb Chris M. Thomasson:
>>> On 3/26/2024 3:12 AM, Bonita Montero wrote:
>>>> Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
>>>>> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>>>>>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>>>>>> On 3/23/2024 1:52 PM, Chris M. Thomasson wrote:
>>>>>>>> On 3/23/2024 9:53 AM, Bonita Montero wrote:
>>>>>>>>> I've got a nice idea for a new processor-extrension for spin-wait
>>>>>>>>> -loops. The idea is that a thread of a processors enters a sleep
>>>>>>>>> state if a word in memory is equal to a certain register until
>>>>>>>>> the cacheline containing the word is modified or there's a timeout
>>>>>>>>> according to the timestamp-counter's value.
>>>>>>>>> This would eliminate active spinning and polling a value in
>>>>>>>>> memory.
>>>>>>>>> Polling would occur only if the cacheline would be modified by
>>>>>>>>> another thread.
>>>>>>>>
>>>>>>>> futex
>>>>>>>
>>>>>>> MWAIT?
>>>>>>
>>>>>> MWAIT has no timeout.
>>>>>>
>>>>>
>>>>> Not sure how important it would be for MWAIT to have a timeout...
>>>>> You are referring to user space, right?
>>>>
>>>> MWAIT could be used for limited spinning like glibc's pthread_mutex
>>>> is capable. The advantage of a MWAIT with timout would be much less
>>>> interconnect-traffic compared to polling.
>>>>
>>>
>>> MWAIT is meant to get around polling?
>>
>> MWAIT could replace polling / spinning on a mutex for a limited
>> time if it would have a timeout.
>>
>
> So, you timeout, check some other stuff, then wait again. Still sounds
> like polling?

Sounds like you want a hardware based futex.

Re: Idea for spin-wait loops

<uu0o9i$2oiqf$1@raubtier-asyl.eternal-september.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@gmail.com (Bonita Montero)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Wed, 27 Mar 2024 10:18:47 +0100
Organization: A noiseless patient Spider
Lines: 8
Message-ID: <uu0o9i$2oiqf$1@raubtier-asyl.eternal-september.org>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me>
<utvar6$2b6dl$1@raubtier-asyl.eternal-september.org>
<utvb9l$2anr0$6@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 27 Mar 2024 09:18:42 +0100 (CET)
Injection-Info: raubtier-asyl.eternal-september.org; posting-host="1d65ead137760b0a4be27896c26d772e";
logging-data="2902863"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+z64TiwCTaB0A9NB0SCH+b1eBdyyUVWAo="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Q+zNDrR0jCp7s2kVxi+amils0X8=
Content-Language: de-DE
In-Reply-To: <utvb9l$2anr0$6@dont-email.me>
 by: Bonita Montero - Wed, 27 Mar 2024 09:18 UTC

Am 26.03.2024 um 21:30 schrieb Chris M. Thomasson:

> So, you timeout, check some other stuff, then wait again.
> Still sounds like polling?

The checks only would occur if the cacheline containing the
word actually was modified.

Re: Idea for spin-wait loops

<20240327180957.000049c7@yahoo.com>

  copy mid

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

  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!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Wed, 27 Mar 2024 17:09:57 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <20240327180957.000049c7@yahoo.com>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me>
<utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 27 Mar 2024 15:10:06 +0100 (CET)
Injection-Info: dont-email.me; posting-host="7b204cfacddec9ea40fe7f02c22d0111";
logging-data="3038870"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OtvUpUoDpYHMllREmZBHTiP/4yxYvLUE="
Cancel-Lock: sha1:SGte/gO5QNIn7oyROZvAwxyfQ6E=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Wed, 27 Mar 2024 15:09 UTC

On Tue, 26 Mar 2024 13:02:47 -0700
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:

> On 3/26/2024 3:12 AM, Bonita Montero wrote:
> > Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
> >> On 3/23/2024 11:38 PM, Bonita Montero wrote:
> >>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
> >>>>
> >>>> MWAIT?
> >>>
> >>> MWAIT has no timeout.
> >>>
> >>
> >> Not sure how important it would be for MWAIT to have a timeout...
> >> You are referring to user space, right?
> >
> > MWAIT could be used for limited spinning like glibc's pthread_mutex
> > is capable. The advantage of a MWAIT with timout would be much less
> > interconnect-traffic compared to polling.
> >
>
> MWAIT is meant to get around polling?

I don't know what you mean by 'get around'.
The main point of original Monitor/MWAIT is to allow to one SMT thread
to do polling on memory address in a way that consumes almost no core's
execution resources thus allowing to the other SMT thread(s) of the
same core to run faster. The sort of more intelligent PAUSE.
In the absence of other SMT threads the main advantage of polling
loop with Monitor/MWAIT vs simple tight polling loop (STPL) is reduced
power consumption.
As far as cache coherence traffic (CCT) is concerned, Monitor/MWAIT
polling loop provides virtually no advantage relatively to STPL. Both
are quite efficient from CCT perspective, at least as long as programmer
does not do anything stupid.

Later on Intel invented 'MWAIT for Power Management' that has slightly
different objectives. But that is O.T.

Re: Idea for spin-wait loops

<uu1tpq$31mt7$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.c++
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c++
Subject: Re: Idea for spin-wait loops
Date: Wed, 27 Mar 2024 12:58:50 -0700
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <uu1tpq$31mt7$1@dont-email.me>
References: <utn1eh$3oeks$1@raubtier-asyl.eternal-september.org>
<utnff2$3rn1f$1@dont-email.me> <utnfoq$3s1eu$1@dont-email.me>
<utoho8$6p4u$2@raubtier-asyl.eternal-september.org>
<uttd1r$1ervd$1@dont-email.me>
<utu71j$1obp8$1@raubtier-asyl.eternal-september.org>
<utv9l7$2anr0$2@dont-email.me> <20240327180957.000049c7@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 27 Mar 2024 19:58:50 +0100 (CET)
Injection-Info: dont-email.me; posting-host="ce6d535e2aab3bd64151fc336b26b1ea";
logging-data="3201959"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Bugqe6WImb1NBJpAv0EiGA/iCMafEE4A="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:IKaDU+DeO6ma4OIS28uoZ2oIlcQ=
Content-Language: en-US
In-Reply-To: <20240327180957.000049c7@yahoo.com>
 by: Chris M. Thomasson - Wed, 27 Mar 2024 19:58 UTC

On 3/27/2024 8:09 AM, Michael S wrote:
> On Tue, 26 Mar 2024 13:02:47 -0700
> "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> wrote:
>
>> On 3/26/2024 3:12 AM, Bonita Montero wrote:
>>> Am 26.03.2024 um 03:48 schrieb Chris M. Thomasson:
>>>> On 3/23/2024 11:38 PM, Bonita Montero wrote:
>>>>> Am 23.03.2024 um 21:58 schrieb Chris M. Thomasson:
>>>>>>
>>>>>> MWAIT?
>>>>>
>>>>> MWAIT has no timeout.
>>>>>
>>>>
>>>> Not sure how important it would be for MWAIT to have a timeout...
>>>> You are referring to user space, right?
>>>
>>> MWAIT could be used for limited spinning like glibc's pthread_mutex
>>> is capable. The advantage of a MWAIT with timout would be much less
>>> interconnect-traffic compared to polling.
>>>
>>
>> MWAIT is meant to get around polling?
>
> I don't know what you mean by 'get around'.

Turing a "hot" spin wait into a cooler one...

;^)

> The main point of original Monitor/MWAIT is to allow to one SMT thread
> to do polling on memory address in a way that consumes almost no core's
> execution resources thus allowing to the other SMT thread(s) of the
> same core to run faster. The sort of more intelligent PAUSE.
> In the absence of other SMT threads the main advantage of polling
> loop with Monitor/MWAIT vs simple tight polling loop (STPL) is reduced
> power consumption.
> As far as cache coherence traffic (CCT) is concerned, Monitor/MWAIT
> polling loop provides virtually no advantage relatively to STPL. Both
> are quite efficient from CCT perspective, at least as long as programmer
> does not do anything stupid.
>
> Later on Intel invented 'MWAIT for Power Management' that has slightly
> different objectives. But that is O.T.
>

Indeed.


devel / comp.lang.c++ / Re: Idea for spin-wait loops

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor