Re: Coding Challenge



On Fri, 30 Sep 2005 14:26:36 +0100, Thomas Hawtin
<usenet@xxxxxxxxxxxxxxxxx> wrote or quoted :

>There's an interesting bug in the Bug Parade. Apparently AWT was found
>to have 2486 potential deadlocks, using JMTA. Perhaps something similar
>could be done for race conditions (which Swing has a number of).
>
>http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231322

After reading that I began to wonder if we are all wet on the way
handle locks. Perhaps the way they should work is you have to get all
your desired locks together and ask for them ALL at ONCE. Then the
locks themselves have a unique internal priority that define the order
you have to grab them. Attempting to grab a set automatically
releases everything you already have.

That would introduce a basketful of other problems, but perhaps things
might work that way within lock groups.

Another idea is locks within groups have priority numbers. You can't
grab a lock within a group with priority higher than you have already,
at least in assertions on mode.


--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.