hadoop-zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Dunning <ted.dunn...@gmail.com>
Subject Re: how to lock one-of-many ?
Date Tue, 23 Feb 2010 18:27:35 GMT
I think that the crux of Mahadev's suggestion is that you do as you say, but
you should try the resources in randomized order.

That will have very robust properties, especially with more than a handful
of resources and is easy to code and to analyze.

It won't work if you really mean "lock first available from this sequence".

On Tue, Feb 23, 2010 at 4:05 AM, Martin Waite <waite.134@googlemail.com>wrote:

> For locking, I could loop through
> the available ids, attempting to create a lock for that in the locked
> directory.  However this seems a bit clumsy and slow.  Also, the locks are
> held for a relatively short time (1 second on average), and by time I have
> blundered through all the possible locks, ids that were locked at the start
> might be available by time I finished.
>



-- 
Ted Dunning, CTO
DeepDyve

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message