Cache Line Alignment
Why would you use alignas(64) on a variable in a multithreaded program?
struct alignas(64) Counter {
std::atomic<int> value;
};
Counter counters[NUM_THREADS];
Sign in to answer questions and track your progress
Sign InWhy would you use alignas(64) on a variable in a multithreaded program?
struct alignas(64) Counter {
std::atomic<int> value;
};
Counter counters[NUM_THREADS];
Sign in to answer questions and track your progress
Sign In