[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: malloc, thread and alignment
Le 26/03/2015 15:13, Emmanuel Dreyfus a écrit :
Allocations are packed tightly together, which can be an issue for
threaded applications. If you need to assure that allocations do not
suffer from cache line sharing, round your allocation requests up to
nearest multiple of the cache line size.
Do we are example of how it should be done? I do not know how to
cache line size, neither do I know how I can specify alignment based on
For x86 you can look at cpuctl(8), identifycpu() uses cpuid to get this
information. This is MD and varies between AMD/Intel, revisions... This
requires not-so-funny tests to deduce the correct value. I don't think
this is exposed through headers/libs for external use though.
AFAICT !x86 platforms have nothing.
Main Index |
Thread Index |