Danger Will Robinson! Missing API!

Charles Oliver Nutter headius at headius.com
Thu May 26 02:53:34 PDT 2011


On Thu, May 26, 2011 at 3:16 AM, John Rose <john.r.rose at oracle.com> wrote:
> You are right about the questions.  That's one of the first things to annoy me about an API:  mutators w/o queries.
>
> We omitted it because it's not a very trustworthy query.  But it's easy to add.
>
> Here's possible javadoc:
>
>    /**
>     * Determines if this switchpoint is still valid.
>     * <p>
>     * Since invalidation is a global and immediate operation,
>     * this query must be sequenced with any
>     * other threads that could invalidate this switchpoint.
>     * It may therefore be expensive.
>     * <p>
>     * In addition, due to concurrent invalidations by other threads,
>     * a switchpoint may report itself as valid, and yet become
>     * invalid before the querying thread begins to act on the
>     * supposed validity.
>     * @return true if this switchpoint has never been invalidated
>     */
>    public boolean isValid() {...}

Looks good.

I also appreciate the explicit description of threading effects and
resulting overhead...this would be fine for my situation (making this
check only when compiling fast-path math operations, which should be
rare) but I am curious...why would isValid have a higher impact than
Rémi's SwitchPoint.gwt trick? Or would it?

- Charlie


More information about the mlvm-dev mailing list