Getting locks and sharing: was RE: Getting concurrency
Vlad Dumitrescu XX (LN/EAB)
Thu Jun 16 12:37:15 CEST 2005
From: Thomas Lindgren
>--- Vlad Dumitrescu <>
>> In-between I see another way, that I like most: let
>> the framework be hidden
>> behind the regular bifs, making the whole mechanism
>> completely transparent.
>> Then all applications could use it. Since it's
>> integrated in the vm, it
>> could do things better than an Erlang-only solution.
>Sounds sensible -- that's the way I would start too.
>You can probably write a good part of this in Erlang
>too, as a library or a framework. Then drop down to C
>as the situation demands.
Yes, it can be done in Erlang as a proof of concept (it is the "framework" solution). But since bifs are affected, an Erlang-only solution can't be transparent. There might also be distribution details not accesible from Erlang (just a supposition).
Earlier I said:
> - a spawn bif that does load balancing behind the scenes
> (but looks >like a local spawn)
> - a way to let the node cluster look as just one node to
> the outside (including the global registration service), but
> still be able to identify each other.
After some more thinking, the second part seems trickier than I first thought.
With the current distribution mechanism, the only possible setup is to have a master node that gets registered and is visible from outside, and some slave hidden nodes (as was pointed out earlier).
This however means that all traffic to the outside will have to go through the master node, possibly making it a bottleneck. Also, what if it crashes? (it happens sometimes :-)
Also, the slave nodes must be aware of their situation and for example return the master's name when asked for their name.
This is only important with Erlang-intensive traffic, sockets should work without any trouble.
More information about the erlang-questions