harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mikhail Fursov" <mike.fur...@gmail.com>
Subject Re: [drlvm][jit] MMTk-style magics implementation in Jitrino.OPT compiler
Date Fri, 29 Sep 2006 15:32:12 GMT
All,
I finished 'unboxed' package implementation in Jitrino.OPT. The patch is in
JIRA 1489
The potential problems:
1) We still do not have a test suite.
2) Two bugs in Jitrino.OPT CG prevents us from use load/store by offset
operations sometimes. I going to fix both of these bugs on Monday.

Anyway, I think we will be ready to write helpers with 'magics' next week.

On 9/22/06, Robin Garner <robin.garner@anu.edu.au> wrote:
>
> > On 9/21/06, Mikhail Fursov <mike.fursov@gmail.com> wrote:
> >>
> >> Weldon, Robin
> >> thank you for the comments.
> >> There are just a few steps left to do before Jitrino.OPT will have
> >> usable
> >> "unboxed" package implementation.
> >>
> >> Right now I'm working on atomic operations (prepare/attempt pair), and
> I
> >> do
> >> not completely understand the semantic of the 'prepare' method.
> >> The "prepareXYZ" method looks like a simple load and is not an atomic
> >> operation by itself. Are there any examples that describe these
> >> operations
> >> in details?
> >
> >
> >
> > Robin will correct me if I am wrong.
> >
> > I think the idea is that this is a generic API intended to be used for
> > accessing "compare and swap" facilities on a bunch of different
> hardware.
> > And the actual hardware has different memory models, different CAS
> > semantics, etc.
> >
> > Basically the generic facility needed is to first read the CAS target
> > memory
> > location (this is the "prepare").  If the memory is sitting at a
> specific
> > value (this is the "do something"), then do an "attempt" as follows:
> >
> > old_contents =  CAS(expected_specfic_value_that_I_just_read,
> > some_new_value,
> > target_memory_location)
> >
> > If the old_contents are identical to
> > expected_specific_value_that_I_just_read, we know that the CAS
> succeeded.
> > In other words, you won the competition.  Otherwise you lost.
> >
> > I imagine the following situation in user's code:
> >>
> >> prepareXYZ()
> >> do something
> >> attempt()
> >>
> >> Is this code correct?
> >>
>
> You're correct.
>
> The prepare/attempt was designed to match architectures (PPC, Alpha ...)
> with a load-locked/store-conditional instruction pair.
>
> The standard code fragment for a synchronized update is
>
> do {
>   oldVal = x.prepare();
>   newVal = f(oldVal);
> } while (!x.attempt(oldVal,newVal));
>
> As an aside, vmmagic should probably have CAS as a primitive rather than
> prepare/attempt, but I don't think that's going to happen in the immediate
> future.
>
> cheers
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Mikhail Fursov

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message