Closed
Description
Jitted code generated for ThreadPoolWorkQueue.EnsureThreadRequested
shows that the offset to the field is not cache-line separated from prior fields as requested.
Replacing the field declaration with the following seems to work as expected:
[StructLayout(LayoutKind.Sequential)]
private struct CacheLineSeparated
{
private readonly Internal.PaddingFor32 pad1;
public volatile int numOutstandingThreadRequests;
private readonly Internal.PaddingFor32 pad2;
}
private CacheLineSeparated _separated;