On Mon, Mar 29, 2010 at 4:45 PM, Mahadev Konar <maha...@yahoo-inc.com>wrote:

> Hi Taylor,
>  Really glad to see that you'd like to work on the recipes. As per your
> questions, comments are in lined:
>
> > - it should implement the java.util.concurrent interfaces so that the
> > implementation may be used by anyone already familiar with the
> > java.util.concurrent.* interfaces
> The problem with implementing concurrent interfaces is that we do not have
> a
> nice way to propagating errors back to the application in case of errors.
> It
> is very much possible that if you have acquired a lock using lock(), you
> might lose it because of some session expiry or network connection loss
> which corresponds to you losing the ownership of the lock.
>
> I am not sure how we could get arnd this. Though throwing RuntimeExceptions
> for lock()/unlock() might solve part of the problem but not all of it.
>

This is a good point - I suppose implementing a semaphore would be a better
approach and would map more closely to the available operations.


>
> > - it should be located in a jar that is easily accessible in a standard
> > location but I don't see a standard way of writing and making available
> > value-add libraries on top of ZooKeeper primitives - is there one?
> I am not sure what you mean by that? Do you want to publish the jar onto
> maven?
> > - there are some minor issues with safe publication of mutable values in
> the
> > code provided that should be fixed
> >
> Please go ahead and file a jira. Patches are always wecome! :)

> May someone please inform me on the best way to proceed?
>
> The best way would be to open a jira and start a discussion on it. You can
> put forward your proposal on the jira and then ask for feedback.
>
>
Ok - when I scrounge up some more time I would like to continue with this
thread - I had a deeper look at the concurrent classes after your comment
and many of them will likely map properly from a conceptual pov - and then
others won't (like Locks).  Mostly the Queue class will (and it has an
available interface to implement) while others like CountDownLatch and
CyclicBarrier and AtomicInteger map reasonably well conceptually, but there
is no interface to implement (can only just copy the signature).

Reply via email to