4 ms·
State being assigned to a single thread removing the need to use locks is a major selling point of Erlang/BEAM.
by tybit 6y ago
State being assigned to a single thread removing the need to use locks is a major selling point of Erlang/BEAM.
- unrealhoang 6y agoThis post is about the architecture to pin multiple tasks (read erlang processes) that use the same data shard (read shared data) on to a single thread to avoid lock and furthermore, never block on that thread to avoid context switch.
- imtringued 6y agoThe only requirement the actor model demands is that actors only have access to their own data but how actors are scheduled is up to the runtime. It could be that Erlang/BEAM does pin actors to a single thread and then pins those threads to a single core but it is not 100% necessary.
- dnautics 6y agononetheless, the BEAM does do that, and only revokes actors from a core under certain conditions (power saving). Also it's important to note that the BEAM is not "the actor model" so it is not bound by the requirements thereof, it just "looks like an actor if you squint at it a little bit".