Thread safety and nethod handle chains
Mark Roos
mroos at roos.com
Fri Aug 19 21:15:15 PDT 2011
Hi John
The thought experiment is that I have a long GWT chain and two threads are
racing down it.
Each is looking for the same missing class.
The end fallback/lookup is synchronized and so there is only one update at
a time, but the
new GWT is added to the start of the chain and the second thread is past
that point. So
when the second gets to the fallback it still thinks the class is missing
so it adds it again.
The issue would be that the entry to the target is not synchronized.
Does this make sense?
mark
mlvm-dev-bounces at openjdk.java.net wrote on 08/19/2011 08:05:37 PM:
> From: John Rose <john.r.rose at oracle.com>
> To: Da Vinci Machine Project <mlvm-dev at openjdk.java.net>
> Date: 08/19/2011 08:14 PM
> Subject: Re: Thread safety and nethod handle chains
> Sent by: mlvm-dev-bounces at openjdk.java.net
>
> On Aug 11, 2011, at 3:01 PM, Rémi Forax wrote:
>
> > Yes, you can have duplicate GWTs and
> > I'm also interested if someone find a better approach :)
>
> You can use a custom subclass of MutableCallSite which synchronizes
> its updates.
> That way two racing threads cannot install duplicate case-handling
logic.
> Or am I missing the point?
>
> -- John
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20110819/e65d787d/attachment.html
More information about the mlvm-dev
mailing list