Use of spinlocks in Erlang

Andreas Schultz andreas.schultz@REDACTED
Tue Jan 7 10:01:12 CET 2020


Hi,

There is an interesting discussion going on about the "correct" use of
spinlocks in user space applications on Linux on the LKML. That discussion
prompted me to check the OTP source on how locks are implemented.
Some of the arguments of the LKML discussion would seem to apply to the
spinlocks (and maybe event the mutexes) used in Erlangs ERTS as well.

The main takeaway seem to be this quote from Linus:

> I repeat: *do not use spinlocks in user space, unless you actually know
what you're doing*. And be aware that the likelihood that you know what you
are doing is basically nil.

Could any of the Erlang gurus or ERTS developers comment on the use of
home grown mutexes and spinlocks in Erlang in light of that discussion?

Blog post that started it:
https://probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is/
Linus's response:
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189723
Author's response:
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189747
Linus follow up:
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189755
Linus additional follow up:
https://www.realworldtech.com/forum/?threadid=189711&curpostid=189759

Many thanks
Andreas
-- 

Andreas Schultz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20200107/8cf18c29/attachment.htm>


More information about the erlang-questions mailing list