I am a C++ habitat working on a C# project.
I have encountered the following situation.
I have class MyClass and want to avoid any 2 objects of type MyClass ever to share a cache line even if I have an array or any sequential collection of type MyClass.
In C++ we can declare class alignas(hardware_destructive_interference_size) Myclass and this will make sure that any 2 objects never share a cache line.
Is there any equivalent method in C#?