{"action":"reopened","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/2383","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/2383/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/2383/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/2383/events","html_url":"https://github.com/dotnet/coreclr/issues/2383","id":122881458,"number":2383,"title":"ThreadPool's UnfairSemaphore Interlocked64 operation on misaligned address in x86","user":{"login":"JeffCyr","id":2624074,"avatar_url":"https://avatars.githubusercontent.com/u/2624074?v=3","gravatar_id":"","url":"https://api.github.com/users/JeffCyr","html_url":"https://github.com/JeffCyr","followers_url":"https://api.github.com/users/JeffCyr/followers","following_url":"https://api.github.com/users/JeffCyr/following{/other_user}","gists_url":"https://api.github.com/users/JeffCyr/gists{/gist_id}","starred_url":"https://api.github.com/users/JeffCyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeffCyr/subscriptions","organizations_url":"https://api.github.com/users/JeffCyr/orgs","repos_url":"https://api.github.com/users/JeffCyr/repos","events_url":"https://api.github.com/users/JeffCyr/events{/privacy}","received_events_url":"https://api.github.com/users/JeffCyr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-18T05:23:52Z","updated_at":"2015-12-18T20:28:54Z","closed_at":null,"body":"The UnfairSemaphore uses a 64bit structure to store its state and swap the values with FastInterlockCompareExchangeLong. This could have a performance hit if the address is not 64bit aligned in x86.\r\n\r\nhttps://github.com/dotnet/coreclr/blob/master/src/vm/win32threadpool.h#L161\r\n\r\nI reproduced the issue in c# when I ported the UnfairSemaphore to make a custom ThreadPool, on a particular scenario I get a 10x performance hit when the address is misaligned.\r\n\r\nHowever I could not reproduce the issue with the CLR ThreadPool, is the address always 64bit aligned in the clr runtime for a reason I'm not aware of?"}}