[RFC][plugin]: fix fixme
Dr Andrew John Hughes
ahughes at redhat.com
Wed Mar 30 13:22:45 PDT 2011
On 10:46 Wed 30 Mar , Deepak Bhole wrote:
snip...
> Why not synchronize the whole function? The whole body is synchronized
> on a static variable anyway. I think the multi-threaded map access is a
> genuine potential problem. Making the reference and unreference
> functions synchronized and keeping everything else as is should be
> enough to address that.
>
They aren't the same thing. Making the methods synchronised is equivalent
to wrapping the body in synchronized (this) and wouldn't protect against
access to the maps from another instance.
I don't see the immediate reason for three maps, but I don't know the rest
of this code that well. Can you explain how 'multi-threaded map access is
a genuine potential problem'? nextID is not going to take a long amount of
time so keeping objects locked over that period doesn't seem an issue.
> Cheers,
> Deepak
>
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the distro-pkg-dev
mailing list