RE: JavaMemoryModel: Ordering of volatile and monitor actions

From: Sarita Adve (sadve@cs.uiuc.edu)
Date: Fri Jun 29 2001 - 17:42:37 EDT


Note that my examples reorder with respect to simple writes. Are writes
considered side-effects?

Also, in example 1, the loop is after a write, and is moved before it.

Sarita

> -----Original Message-----
> From: cliffc@jaberwocky.eng.sun.com
> [mailto:cliffc@jaberwocky.eng.sun.com]On Behalf Of Clifford Click
> Sent: Friday, June 29, 2001 4:34 PM
> To: Sarita Adve
> Cc: javamemorymodel@cs.umd.edu
> Subject: Re: JavaMemoryModel: Ordering of volatile and monitor actions
>
>
>
> Sarita Adve wrote:
>
> > Comments and questions
> > -----------------------
> >
> > (1) Is there existing compiler work/convention on reordering
> with respect to
> > potentially unbounded loops?
>
> Yeah, it's generally considered broken to move side effects
> across unbounded
> loops. The general example used is:
> while( complex-condition-which-is-never-true ) { }
> fire_nuke_missle_at_russia();
>
> HotSpot won't move side effects across loops it can't prove will
> terminate.
>
> It's usually adequate (for compilers) to say something about
> 'finite time':
> "It's ok to move around side-effects as long as they would
> happen after a finite amount of time anyways"
>
>
> Cliff
>
>
> --
> Cliff Click Compiler Designer and Researcher
> cliffc at acm.org Java Software
> (408) 863-3266 MS UCUP02-302

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:32 EDT