[concurrency-interest] question about java.lang.reflect

Dhanji R. Prasanna dhanji at gmail.com
Sun Mar 25 19:36:42 EDT 2007


Hi

I am curious if the reflection classes do any synchronization? Particularly,
I have got multiple threads using the same Field (and Method) to mutate
thread-local objects of the same class. The Fields and Methods are
introspected only once (and cached in "final" members) before any other
threads have access to them.

But does Field or Method have a critical section that may be a chokepoint?
If so, am I better off constructing a synthetic class to mutate the objects
at runtime? I know the latter would be faster, but I am curious if it is
faster due to the fact that it's a static invocation, rather than a
synchronization chokepoint.
Thanks,

Dhanji.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20070326/087adf8e/attachment.html 


More information about the Concurrency-interest mailing list