Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Aspect reentrancy

Hi all.

Just a few follow-up questions and comments from my side.

Oege wrote:
>  I do not think your proposal of making ifs in advice and in
>  pointcuts equivalent is a good plan. For one thing, partial
>  evaluation of pointcut matching will have to be scrapped,
>  disabling almost all compiler optimisations for AspectJ.
>  For instance you could add "if(0 !=1)" to your example
>  pointcut. Now under your semantics, I would still have to
>  generate the joinpoint for the other if, or would you
>  make it nondeterministic whether that joinpoint occurs
>  or not?

This is an interesting problem which I did not see when Eric and I
first discussed evaluation of if-pointcuts. In general I agree with
Eric Tanter that sensible semantics are more important than
performance considerations but surely generating
"if-pointcut-evaluation joinpoints" at every single other (?)
joinpoint could lead to huge performance degradations. Resorting to a
nondeterministic strategy might be a comfortable way out. That way one
would still be guaranteed that *when* the if-pointcut gets evaluated
all possible pieces of advice are applied to its lexical scope. If
not, just nothing would happen. This is similar to semantics pointcuts
like maybeShared() [1].

Also if one wanted to implement "non-reentrant by default", I do not
actually think that the cost for this implementation would be
prohibitively high. For example, a simple aspect-specific thread-local
counter should suffice to indicate that the related advice is
currently executing, just as in cflow. Surely this would not come for
free but thread-local counters should not be too expensive at least
with current JDKs.

That's just my subjective opinion however, and I would be happy to
receive other people's comments on this.

Eric

[1]
RACER: Effective race detection for Java using AspectJ (draft)
To appear at ISSTA '08.
http://www.bodden.de/pubs/bh08racer-draft.pdf

-- 
Eric Bodden
Sable Research Group
McGill University, Montréal, Canada


Back to the top