Looked into that this morning.

It occurred to me that would definitely make it thread-safe, but alone doesn't 
give us the right logic for AnnotatedType.getMethods(), etc. which are supposed 
to return a complete list not a list being updated.  So we'd still need to 
block getMethods() calls until initialization is complete.

Updated the code again.  Have a look and let me know if you see any more holes 
:)  The lists not being thread safe was definitely accurate.


-David

On May 11, 2013, at 11:49 PM, Romain Manni-Bucau <[email protected]> wrote:

> I keep my comment/explanation on it, if you want it thread safe at runtime
> convert it to sthg thread safe...copyonwriteXXX structures will be enough.
> We dont need what you did IMO
> Le 12 mai 2013 00:04, "David Blevins" <[email protected]> a écrit :
> 
>> 
>> On May 11, 2013, at 1:59 PM, David Blevins <[email protected]>
>> wrote:
>> 
>>> That being said, I'll see if I can reduce the memory requirement of the
>> fix.
>> 
>> Done.  Managed to reduce the memory requirement of the original code for
>> the lazy case as well.  Basically two object references lighter (128 bits).
>> 
>> Thread-safe, lighter and slightly more immutable.
>> 
>> 
>> -David
>> 
>> 

Reply via email to