RFR: 8283044: Use asynchronous handshakes to deliver asynchronous exceptions [v3]
David Holmes
dholmes at openjdk.java.net
Tue Mar 29 00:58:54 UTC 2022
On Mon, 28 Mar 2022 20:56:54 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>> src/hotspot/share/runtime/thread.cpp line 1667:
>>
>>> 1665: }
>>> 1666:
>>> 1667: class InstallAsyncExceptionHandshake : public HandshakeClosure {
>>
>> Should this class still have Closure in its name?
>>
>> I'm unclear why we need this class to wrap an AsyncExceptionHandShake ??
>
> I looked at the suspend handshakes (ThreadSelfSuspensionHandshake, SuspendThreadHandshake) and followed that naming convention. But now doing a grep I see that most handshakes have Closure instead at the end, some have HandshakeClosure, and some just have handshake at the beginning(HandshakeForDeflation, HandshakeForPD) . Not sure now which one we should use. It seems it should be either Closure or HandshakeClosure at the end.
> Regarding InstallAsyncExceptionHandshake, we need it to execute the first handshake that installs the actual asynchronous handshake. The closure of that asynchronous handshake is stored in InstallAsyncExceptionHandshake::_aeh.
Hmmm ... I'm having trouble following the control flow here so will re-examine.
The naming issue is a concern ... perhaps @robehn can comment?
>> src/hotspot/share/runtime/thread.hpp line 819:
>>
>>> 817: inline void set_pending_unsafe_access_error();
>>> 818: static void send_async_exception(JavaThread* jt, oop java_throwable);
>>> 819: static void send_async_exception(JavaThread* jt, AsyncExceptionHandshake* aec);
>>
>> I'm not seeing where this new method gets called?
>
> I added that overload for Panama, in case they decide to use asynchronous handshakes to solve their cleanup of mapped memory issues. Same thing with virtual method should_throw() in AsyncExceptionHandshake, since they wanted to do some check first in the handshake to decide if they should throw. But I could remove them.
Better to not add them until actually needed. Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7930
More information about the hotspot-runtime-dev
mailing list