Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #118561

Re: Idea for spin-wait loops

From "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Idea for spin-wait loops
Date 2024-03-26 13:30 -0700
Organization A noiseless patient Spider
Message-ID <utvb9l$2anr0$6@dont-email.me> (permalink)
References (3 earlier) <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>

Show all headers | View raw


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?

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-23 17:53 +0100
  Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-23 13:52 -0700
    Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-23 13:58 -0700
      Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-24 07:38 +0100
        Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-25 19:48 -0700
          Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-26 11:12 +0100
            Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-26 13:02 -0700
              Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-26 21:23 +0100
                Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-26 13:30 -0700
                Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-26 13:31 -0700
                Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-27 10:18 +0100
              Re: Idea for spin-wait loops Michael S <already5chosen@yahoo.com> - 2024-03-27 17:09 +0200
                Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-27 12:58 -0700
    Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-24 07:37 +0100
      Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-24 12:33 -0700
    Re: Idea for spin-wait loops scott@slp53.sl.home (Scott Lurndal) - 2024-03-24 20:43 +0000
      Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-25 07:23 +0100
      Re: Idea for spin-wait loops Michael S <already5chosen@yahoo.com> - 2024-03-25 14:34 +0200
        Re: Idea for spin-wait loops Michael S <already5chosen@yahoo.com> - 2024-03-25 19:11 +0200
        Re: Idea for spin-wait loops Bonita Montero <Bonita.Montero@gmail.com> - 2024-03-25 18:53 +0100
          Re: Idea for spin-wait loops "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2024-03-26 13:13 -0700

csiph-web