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


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

Re: Christmas Quiz...

From "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups comp.lang.c++
Subject Re: Christmas Quiz...
Date 2022-12-27 13:29 -0800
Organization A noiseless patient Spider
Message-ID <tofo3e$3nhm2$2@dont-email.me> (permalink)
References <tod3b8$3c8u8$4@dont-email.me> <todqib$3hkat$3@dont-email.me>

Show all headers | View raw


On 12/26/2022 7:59 PM, Bonita Montero wrote:
> Am 26.12.2022 um 22:22 schrieb Chris M. Thomasson:
>> Imagine you are on a SPARC in RMO mode, you are programming in 
>> assembly language. What memory barrier instruction is the most 
>> efficient _and_ correct for use _after_ using an atomic RMW 
>> instruction to take exclusive access? Think about locking a mutex...
>>
>> A: MEMBAR #LoadLoad
>>
>> B: MEMBAR #LoadStore | #LoadLoad
>>
>> C: MEMBAR #StoreLoad | #LoadLoad
>>
>> D: MEMBAR #StoreLoad | #StoreStore
>>
>>
>> What about the membar we have to use before atomically unlocking this 
>> mutex?
>>
>>
>> A: MEMBAR #LoadLoad
>>
>> B: MEMBAR #StoreLoad | #LoadLoad
>>
>> C: MEMBAR #LoadStore | #StoreStore
>>
>> D: MEMBAR #StoreLoad | #StoreStore
> 
> 1. I use proper C++ barriers so I won't have to care for that.
> 2. SPARCĀ  is dead.
> 

Well, suppose you were tasked with creating the guts for C++ membars for 
the SPARC. Imvvho, the SPARC in RMO mode is a good place to learn. The 
MEMBAR instruction is pretty damn diverse! :^)

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


Thread

Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-26 13:22 -0800
  Re: Christmas Quiz... "Alf P. Steinbach" <alf.p.steinbach@gmail.com> - 2022-12-26 23:17 +0100
  Re: Christmas Quiz... Bonita Montero <Bonita.Montero@gmail.com> - 2022-12-27 04:59 +0100
    Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-27 13:29 -0800
    Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-01-04 00:40 -0800
      Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-01-04 00:41 -0800
  Re: Christmas Quiz... Michael S <already5chosen@yahoo.com> - 2022-12-27 03:38 -0800
  Re: Christmas Quiz... Michael S <already5chosen@yahoo.com> - 2022-12-27 03:42 -0800
    Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-27 13:31 -0800
      Re: Christmas Quiz... Michael S <already5chosen@yahoo.com> - 2022-12-27 14:09 -0800
        Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-27 14:17 -0800
          Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2022-12-29 20:42 -0800
  Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-01-04 00:38 -0800
  Re: Christmas Quiz... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2023-01-17 18:25 -0800

csiph-web