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


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

Re: Multithreaded Programming : Always use spinlocks for performance?

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Multithreaded Programming : Always use spinlocks for performance?
Date 2022-07-24 11:38 -0700
Organization None to speak of
Message-ID <87v8rmz77o.fsf@nosuchdomain.example.com> (permalink)
References <ccb52fa0-5627-4002-8697-d577b90dab1bn@googlegroups.com> <tbjnbj$m05c$1@dont-email.me> <tbjp5n$memv$1@dont-email.me> <8d6a4871-4c9c-405a-81ad-374a6899cc94n@googlegroups.com>

Show all headers | View raw


Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> writes:
[...]
> void Entry_Point_For_Worker_Thread(void)
> {
>         for (;;)
>         {
>                 while ( false == g_should_process_data );    // <-- This is what I mean when I say 'spin lock'
>
>                 /* Process data */
>         }
> }
[...]

Not relevant to your question, but why would you write
`false == g_should_process_data` rather than `! should_process_data`?

-- 
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Philips
void Void(void) { Void(); } /* The recursive call of the void */

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


Thread

Multithreaded Programming : Always use spinlocks for performance? Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-07-24 06:31 -0700
  Re: Multithreaded Programming : Always use spinlocks for performance? Bo Persson <bo@bo-persson.se> - 2022-07-24 15:53 +0200
  Re: Multithreaded Programming : Always use spinlocks for performance? Bonita Montero <Bonita.Montero@gmail.com> - 2022-07-24 16:42 +0200
  Re: Multithreaded Programming : Always use spinlocks for performance? Paavo Helde <eesnimi@osa.pri.ee> - 2022-07-24 18:09 +0300
    Re: Multithreaded Programming : Always use spinlocks for performance? Bonita Montero <Bonita.Montero@gmail.com> - 2022-07-24 17:41 +0200
      Re: Multithreaded Programming : Always use spinlocks for performance? Frederick Virchanza Gotham <cauldwell.thomas@gmail.com> - 2022-07-24 09:20 -0700
        Re: Multithreaded Programming : Always use spinlocks for performance? Paavo Helde <eesnimi@osa.pri.ee> - 2022-07-24 19:34 +0300
        Re: Multithreaded Programming : Always use spinlocks for performance? Bonita Montero <Bonita.Montero@gmail.com> - 2022-07-24 18:57 +0200
        Re: Multithreaded Programming : Always use spinlocks for performance? Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2022-07-24 11:38 -0700
        Re: Multithreaded Programming : Always use spinlocks for performance? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-07-24 13:17 -0700
          Re: Multithreaded Programming : Always use spinlocks for performance? Öö Tiib <ootiib@hot.ee> - 2022-07-25 03:21 -0700
      Re: Multithreaded Programming : Always use spinlocks for performance? Bonita Montero <Bonita.Montero@gmail.com> - 2022-07-24 19:01 +0200
  Re: Multithreaded Programming : Always use spinlocks for performance? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-07-24 13:20 -0700
    Re: Multithreaded Programming : Always use spinlocks for performance? "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-07-24 16:55 -0700

csiph-web