TMonitor vrs Critical sections revisited.


TMonitor vrs Critical sections revisited.
Back then (https://www.delphitools.info/2013/06/06/tmonitor-vs-trtlcriticalsection/), it was found that critical sections were beating TMonitor hands down. I have rerun the tests in that comparison with Delphi Tokyo and the results appear to be reversed. 0.09 sec for critical sections vers 0.03 sec for TMonitor. Has the performance of TMonitor so massively improved or I am missing something?

Comments

  1. Eric Grange Interesting. Now I'm beginning to wonder what Canvas locking uses, as I (have to!) use that a lot.
    As for SWRL, if you are a radio amateur like I am that error makes perfect sense. (If you're not: https://en.wikipedia.org/wiki/Standing_wave_ratio)
    en.wikipedia.org - Standing wave ratio - Wikipedia

    ReplyDelete
  2. Kiriakos Vlahos Spin locks are bad for contested locks. So they should only be used where you can be sure contention is low.

    ReplyDelete

Post a Comment