[concurrency-interest] JSR-133 Cookbook and exit monitor

thurstonn thurston at nomagicsoftware.com
Wed Oct 8 07:44:59 EDT 2014


David Holmes-6 wrote
> Not only is it allowed, it can easily be performed by the JIT. If that
> seems
> "unhealthy" you will be really freaked out by lock-coarsening which can
> coalesce:
> 
> synchronized(x) {
>  // aaa
> }
> // other code
> synchronized(x) {
>  // bbb
> }
> 
> into
> 
> synchronized(x) {
>   // aaa
>   // other code
>   // bbb
> }
> 
> where anything in the sync block can of course be further reordered.
> 
> Of course this can't be done arbitrarily but it can be done.
> 
> Cheers,
> David Holmes
> 
>>

Thanks.
To be precise, there is a hb(aaa, bbb), surely that needs to be respected in
the rewritten *coalesced* code; as far as "other code", anything goes I
guess



--
View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/JSR-133-Cookbook-and-exit-monitor-tp11323p11328.html
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.


More information about the Concurrency-interest mailing list