let's say some blocking I/O is done in Java such as a long running db query. Is there in general a way in Java that some Java database driver can tell the JVM scheduler that the call has left the JVM and is now being processed by some external system? The JVM could then assign the thread that served the db query for some other operation until the reply from the db has arrived. This way the blocking db query would effectively become non-blocking.
Just wonder whether this can be done on the JVM in general. I do Java for many years now, but I admittedly don't know what the Java scheduler is doing in such a situation.