> On Oct 11, 2019, at 2:50 PM, Garrett D'Amore <garr...@damore.org> wrote:
> 
> The issue is that you can't just arbitrarily throw a mutex out there -- you 
> have to have a place to *store* that, and you can't fit it inside the 64-bit 
> value.  With a 64-bit ISA this isn't usually a problem, but with 32-bit ISAs 
> it is.

I'm not sure how this affects the compiler builtin atomics since they don't add 
mutexes.
 -- richard

> 
> The only way to store the mutex (which could just be a spinlock) is to have 
> some other place that has it -- typically in library code.  Allocation of 
> other objects like that normally falls outside the scope of a compiler 
> builtin (modulo bringing in a separate runtime object file, which can work 
> for user programs but generally not for kernels.)
>> On 10/11/2019 11:38:57 AM, Richard Elling <richard.ell...@richardelling.com> 
>> wrote:
>> 
>> 
>> 
>>> On Oct 9, 2019, at 11:41 AM, Garrett D'Amore <garr...@damore.org 
>>> <mailto:garr...@damore.org>> wrote:
>>> 
>>> I don't think 32-bit compilers generally offer builtins for 64-bit atomics. 
>>>  Frankly, they can't really unless the underlying ISA provides some 
>>> additional support for this in particular.
>> 
>> Yes, that is why the builtins exist... the underlying ISA may have a method 
>> that is not part of the C language.
>> 
>> Worst case, mutex protection will work... slowly.
>>  -- richard
>> 
>>> 
>>> To implement a 64-bit atomic on a 32-bit architecture, you generally needs 
>>> some additional state somewhere -- typically some sort of mutex or 
>>> spinlock.  That has to live somewhere.  (You *might* be able to have a 
>>> compiler builtin that provides this along with a compiler runtime which 
>>> provides an instance of the spinlock somewhere in the program's data 
>>> section.  I think this sort of "builtin" (which isn't really builtin at 
>>> all) generally can't be used in operating system kernels -- e.g. with 
>>> --freestanding.)
>>>> On 10/9/2019 11:26:40 AM, Richard Elling <richard.ell...@richardelling.com 
>>>> <mailto:richard.ell...@richardelling.com>> wrote:
>>>> 
>>>> If it is possible to specify a compiler version, it might be easier to use 
>>>> the compiler 
>>>> builtin atomics. Just sayin' 
>>>> -- richard 
>>>> 
>>>> 
>>>> ------------------------------------------ 
>>>> openzfs: openzfs-developer 
>>>> Permalink: 
>>>> https://openzfs.topicbox.com/groups/developer/T3ee8a81d5f09f2ec-Mabd6346845b79e16d16f57c2
>>>>  
>>>> <https://openzfs.topicbox.com/groups/developer/T3ee8a81d5f09f2ec-Mabd6346845b79e16d16f57c2>
>>>> Delivery options: 
>>>> https://openzfs.topicbox.com/groups/developer/subscription 
>>>> <https://openzfs.topicbox.com/groups/developer/subscription>
> 
> openzfs <https://openzfs.topicbox.com/latest> / openzfs-developer / see 
> discussions <https://openzfs.topicbox.com/groups/developer> + participants 
> <https://openzfs.topicbox.com/groups/developer/members> + delivery options 
> <https://openzfs.topicbox.com/groups/developer/subscription>Permalink 
> <https://openzfs.topicbox.com/groups/developer/T3ee8a81d5f09f2ec-Mb897f16441ee57856b4926b7>

------------------------------------------
openzfs: openzfs-developer
Permalink: 
https://openzfs.topicbox.com/groups/developer/T3ee8a81d5f09f2ec-M51858eebfe98f256ff2d7f42
Delivery options: https://openzfs.topicbox.com/groups/developer/subscription

Reply via email to