Thread safety and nethod handle chains

Mark Roos mroos at roos.com
Mon Aug 22 09:43:49 PDT 2011


Thanks for the commentary to all.  I learn something new each time.

My use of callsites, lookups etc are such that there are lots of lookups ( 
at least
one per generated callsite + class pair).  And lookups vary greatly in 
time, from a quick
IV access to a full generation and compile of the method.  Because of this 
I have not
been too thrilled with synchronizing the lookup and thus forcing long 
waits on threads
which could proceed.

While the thought experiment is potentially rare it does show up when I 
launch multiple
threads on the same task.  Then the callsite usage tends to overlap and I 
start to get
duplicate GWTs.  But is this bad?  Or bad enough to add the overhead of 
collecting GWT
chain information and the analysis.

It should not cause failures as each callsite will invoke it method.  The 
question is which target
update survives.

What I need to look at closely is where to sync.  There could be issues if 
changes to the target occur
between the get, modify and set target operations.  But again one will win 
and the other will
have to lookup again the next time.  I am thinking that it will not turn 
out to be a big deal.

regards
mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20110822/50d62850/attachment.html 


More information about the mlvm-dev mailing list