[erlang-questions] Cost of doing +sbwt?

Lukas Larsson <>
Tue Sep 1 21:42:10 CEST 2015


On Tue, Sep 1, 2015 at 9:14 PM, Paul Davis <>
wrote:

> Also, does anyone have a quick pointer to where the busy wait loop is?
> After I look at the scheduler time I was going to go find that code
> and see if I couldn't come up with a better idea of what exactly might
> be changing with that setting.


This should be the code that does the waiting:
https://github.com/erlang/otp/blob/master/erts/lib_src/pthread/ethr_event.c#L65-L161

The mutex implementation that calls it is in here:
https://github.com/erlang/otp/blob/master/erts/lib_src/common/ethr_mutex.c

The different spin options are set here:
https://github.com/erlang/otp/blob/master/erts/emulator/beam/erl_process.c#L5325-L5364

There are also a couple of other places where it spind in erl_process.c,
just search for spin and you'll find them :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150901/52c5975c/attachment.html>


More information about the erlang-questions mailing list