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];
A

It's required by the C++ standard for all atomic variables

B

It makes atomic operations faster by using wider CPU instructions

C

It ensures each counter occupies its own cache line

D

It forces the variable into L1 cache permanently