RFR: 8291555: Replace stack-locking with fast-locking
Robbin Ehn
rehn at openjdk.org
Thu Oct 6 07:47:17 UTC 2022
On Tue, 16 Aug 2022 16:21:04 GMT, Roman Kennke <rkennke at openjdk.org> wrote:
> Strictly speaking, I believe the conditions check for the (weaker) balanced property, but not for the (stronger) structured property.
I know but the text says:
- "every exit on a given monitor matches a preceding entry on that monitor."
- "implementations of the Java Virtual Machine are permitted but not required to enforce both of the following two rules guaranteeing structured locking"
I read this as if the rules do not guarantee structured locking the rules are not correct.
The VM is allowed to enforce it.
But thats just my take on it.
EDIT:
Maybe I'm reading to much into it.
Lock A,B then unlock A,B maybe is considered structured locking?
But then again what if:
void foo_lock() {
monitorenter(A);
monitorenter(B);
// If VM abruptly returns here
// VM can unlock them in reverse order first B and then A ?
monitorexit(A);
monitorexit(B);
}
-------------
PR: https://git.openjdk.org/jdk/pull/9680
More information about the serviceability-dev
mailing list