[erlang-questions] Global lock is unfair?
Tue May 15 19:52:44 CEST 2018
Thanks for the pointer, Andrew. The process per resource would work, but
how would you ensure that only one process is started per resource? The
only way I know would be to write a central "manager" process that keeps
track of the resource processes and directs traffic according to the
resource "key", ensuring a new process is started when a new resource comes
in demand. On top of that, the manager has to be aware of other nodes in
the cluster and resource processes that might already exist elsewhere
That's still a lot more work than seems necessary.
On Tue, May 15, 2018 at 10:53 AM Andrew Thompson <
> On Mon, May 14, 2018 at 04:53:08PM -0500, Ryan Stewart wrote:
> > Funneling all the calls through a single process would bring the system
> > a grinding halt. Sure, I could write a system of processes, each of which
> > acts as a mutex to one, particular resource, but why would I want to?
> All I
> > need is locking, just like global locks, but fair. It seems like
> > that should already exist in a proven library.
> For simple cases, wrapping a process around the individual resource and
> using it as a lock is actually fine and should scale well. If you want
> something fancier, there's Ulf's library:
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions