Dave Novo 51 Posted June 26, 2020 A few years back, there was a post about potential cache line conflicts with TCriticalSection https://www.delphitools.info/2011/11/30/fixing-tcriticalsection/ The comments indicate it was fixed for TMonitor, but I wonder if anyone knows if it was fixed for TCriticalSection. Looking at the TCriticalSection code in Delphi Seattle, it is very complex, I guess due to cross platform concerns with records, record helpers and then windows API calls all coming into play. I could not find any code there that seems to move things onto a difference cache line, but I definitely could be missing something. Does anyone have any insight into this? 1 Share this post Link to post
Stefan Glienke 2002 Posted June 26, 2020 (edited) Print TCriticalSection.InstanceSize and you know if it was fixed or not - spoiler: no, it was not. On Windows that is - on Posix TCriticalSection simply uses System.TMonitor which allocates at least the size of a cache line Edited June 26, 2020 by Stefan Glienke 1 1 Share this post Link to post