RFR: 8283044: Use asynchronous handshakes to deliver asynchronous exceptions [v4]

Robbin Ehn rehn at openjdk.java.net
Tue Mar 29 08:39:54 UTC 2022


On Mon, 28 Mar 2022 02:40:38 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Thanks for confirming.
>
> Aside: as the handshake filtering mechanism is growing this doesn't look like a scalable approach to dealing with filters - we can't keep adding hardwired filter functions and new parameters to get_op_for_self and its callers. get_op_for_self should be taking a filtering object which in turn is used by queue.peek() to determine what can be returned. Perhaps a use for C++ lambdas?

My original thought was to have the filter in the specific handshake:

class MyHandshake : public HandshakeClosure {
public:
  MyHandshake(Handle throwable) : HandshakeClosure("MyHandshake") {}
  void do_thread(Thread* thr) {}
  bool executeable_for_context(JavaThreadState from, JavaThreadState to, ...) {
  	return to == _thread_in_Java;
  }
};


This would keep what and when together.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7930


More information about the hotspot-runtime-dev mailing list