On Dec 26, 9:34 am, "Bob Lee" <
crazy...@crazybob.org> wrote:
> I'm wary of introducing unnecessary synchronization into critical code
> paths.
My patch introduces synchronization only in the two places where we're
using ReferenceCache with non-String references:
- LineNumbers
- BytecodeGen
Both of these only happen at Injector-creation time. We've already set
a precedent that we permit global (ie. static) synchronization at
Injector-creation time in the implementation of Scopes.SINGLETON. So
this code doesn't introduce any real performance degradation.
> I'm pretty sure I can make ReferenceMap not start the thread unless you try
> to use a weak or soft reference.
If you do, we'll still need to avoid ReferenceCache in LineNumbers and
BytecodeGen. So this synchronization doesn't really go away.
I still think this fix is a net-win for our users...