[concurrency-interest] private field
14 Oct 2004 18:39:33 -0000
> But, is-it possible to improve performance one step
> farther? I am worried about memory allocation and garbage
> collection; maybe we can improve performance by reusing
> LinkedBlockingQueue.Node? [...]
> Now drainTo method requires O(1) instead of O(n) time.
> Also, I can use QueueImpl instead of ArrayList and reuse
> Node (and don't use memory for array), so memory allocation
> and garbage collection will appear less frequently,
> improving performance.
> But, I am wondering about node pool synchronization. I'm
> not sure if I need synchronization and if yes, what are the
> impact on the performance?
I wish the JVM spec would provide for objects to be resurrected
more than once. It seems like it would make implementing pools
efficiently more easy. The dotNET CLR has ReRegisterForFinalize,
which allows objects to be resurrected indefinitely. I hope the
JVM spec will get this feature someday, or does it already?