[erlang-questions] Erlang SMP scheduler details

Nicolas Zea nicolas.zea@REDACTED
Tue Feb 24 22:24:14 CET 2009


Are there any details available on how the SMP scheduler works? I  
found some slides that discuss how there is a global run pool, which  
schedulers get work from, with one scheduler per thread. Does this  
mean everything follows kind of a pull model, and there is no notion  
of actor locality to a particular thread? (ie, if multiple actors are  
available in the run queue, prioritize one that was previously running  
in this thread in the hopes of having less of a 'cold start' in terms  
of cache, branch prediction, tlb misses, etc.).

It was mentioned the current goal is to distribute the run pool as  
well, with some migration logic. I'm guessing this hasn't been  
implemented yet?

Is there any notion of preemption? Or other fairness assurance?

I've been digging through the beam source code, but in all honesty  
that place scares me a bit. Is there any documentation available on  
what all is going on, particularly in relation to the SMP aspects? For  
example, does anyone know where the interaction with OS threads takes  
place, including pulling tasks from the run pool? Is there any  
definition anywhere of what the "lightweight processes" entail, and  
how they get swapped in/out? (continuations?)

Thanks,
Nicolas



More information about the erlang-questions mailing list