new java.util.BitSet and Synchronization

Parmelan, Edouard EP510777 at exchange.FRANCE.NCR.com
Wed Oct 21 07:41:13 PDT 1998


Hi Everybody,

thanks a lot, I finally use this method from Mike:
> Use System.identityHashCode() to get the unique hash codes for each
BitSet, then
> lock the BitSet with the lower identity hash value first.  This guarantees
a
> fixed locking order.

Following the new class with full Synchronisation
and a Test class.

I have also reduce some loops as follow:
  for(i = array.length - 1; i >= 0; i--)
    ...
by
  for(i = array.length; i-- > 0; )
    ...


Edouard.
----
 <<BitSet.tar.gz>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BitSet.tar.gz
Type: application/octet-stream
Size: 3006 bytes
Desc: not available
Url : http://kaffe.org/pipermail/kaffe/attachments/19981021/2a4f938e/attachment-0007.obj 


More information about the kaffe mailing list