[concurrency-interest] transferring queued threads

Endre Stølsvik Online at Stolsvik.com
Tue Apr 14 18:06:11 EDT 2009


On Mon, Apr 6, 2009 at 21:00, Christian Vest Hansen
<karmazilla at gmail.com> wrote:
> Have a lock for each entity; L(A), L(B), L(C) etc. such that each
> entity at any given point in time has exactly one lock. These locks
> have a universal and immutable ordering to them (like
> System.identityHashCode, for instance).

System.identityHashCode can give you the same result for two different
objects, and you'd not be guaranteed a single order on the two
different threads. Use a long sequencer (in addition!).

Endre.


More information about the Concurrency-interest mailing list