[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-dev] Enhancement request/suggestion to define synchronized as a join point

I’m relatively new to AOP/AspectJ and new to this list; if this topic has previously been discussed I apologize for wasting people’s time.

Enhancement Request/Suggestion:

I can see some value in exposing the synchronized verb as an AspectJ join point.

Scenario/Use Case:

In my experience it is reasonably common for an application to behave reasonably in a pre-production environment but to perform badly under load, the cause often proves to be a synchronization issue. To make matters worse, in my experience, the source typically turns out to be a third party jar over which we have no control.

I believe a synchronized join point could help as a diagnostic tool to assist in investigating such problem in the following ways; and may have other applications as well.

1. Providing the ability to track elapsed time of synchronized methods and blocks

2. Providing the ability to log execution sequences leading to lock contention.

3. Providing, through late weaving, the ability to investigate the behavior of classes shipped only in binary form.

4. Provide the ability to be very specific in the targeting of instrumentation, thus minimizing the impact on the system under investigation.


Commercial products exist that provide similar capability but theses are typically very expensive.


Possible additional benefits

1. Ability to enforce synchronization on selected variables at compile time.

2.     Ability to retrofit synchronization to existing code.


Issues:

1. Before advise may need a modifier to select between arrival at the join point and acquisition of the monitor.

2. Possible issues with the execution state with respect to synchronization of code within the advise.


Ray Sutton