harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [jira] Updated: (HARMONY-2092) [drlvm][jit] Harmony works with volatile variables incorrectly
Date Sun, 10 Jun 2007 12:50:34 GMT
On 6/10/07, George Timoshenko <george.timoshenko@gmail.com> wrote:
> The approach exploiting "locked" CMPXCHG8B is ready.
> The patches attached to HARMONY-2092.

Cool!

> This solution is about 1.6 times slower than Jrockit in a special
> microbenchmark heavily utilizing volatile variables of type long.

This is not necessarily because  of the "lock" prefix overhead. JIT
can do a good job to optimize some volatile accesses as it does for
monitor.

Thanks,
xiaofeng

> George Timoshenko wrote:
> >
> >> I had a question in the JIRA about this issue: why don't we use "lock"
> >> prefix for the atomic access?
> >
> > well...
> >
> > Originally we split all 64-bit memory access into 2 ones of 32-bit.
> > It does not have sense to set #LOCK prefix for them. (there is a gap
> > between)
> >
> > We can only set #LOCK to some instruction that reads/writes whole 64 bits.
> >
> > The bad thing is the only instruction (according to IA32 spec) we can
> > set #LOCK to is CMPXCHG8B (MOVQ, MOVSD and any others can not be used
> > with #LOCK)
> >
> > This monster (CMPXCHG8B) requires 4 registers:
> >
> > EAX
> > EBX
> > ECX
> > EDX
> >
> > and (FLAGS) also.
> >
> > I am not sure CMPXCHG8B usage will be faster than making volatile fields
> >   always synchronized (artificially)
> >
> >
> >
> >
>
>


-- 
http://xiao-feng.blogspot.com

Mime
View raw message