Re: will __attribute__((aligned(CACHE_LINE_SIZE))) break struct alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks,

2017-11-07 0:41 GMT+08:00 Jonathan Wakely <jwakely.gcc@xxxxxxxxx>:
> On 6 November 2017 at 15:46, Yubin Ruan wrote:
>> Thanks Florian,
>>
>> 2017年11月6日星期一,Florian Weimer <fweimer@xxxxxxxxxx> 写道:
>>
>>> On 11/06/2017 06:04 AM, Yubin Ruan wrote:
>>>
>>>> I am using something like this:
>>>>
>>>>    struct S1 {
>>>>      int index __attribute__((aligned(CACHE_LINE_SIZE)));
>>>>      struct S2 some_other;
>>>>    };

If I want to make this `index` field occupy one single cache line to
avoid false sharing, will that
`__attribute((aligned(CACHE_LINE_SIZE)))` suffice?

Yubin




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux