RFR: 8329593: Drop adjustments to target parallelism when virtual threads do I/O on files opened for buffered I/O

Alan Bateman alanb at openjdk.org
Mon Apr 22 12:45:53 UTC 2024


On Wed, 3 Apr 2024 10:04:36 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> This change drops the adjustments to the virtual thread scheduler's target parallelism when virtual threads do file operations on files that are opened for buffered I/O. These operations are usually just too short to have any benefit and may have a negative benefit when reading/writing a small number of bytes. There is no change for read/write operations on files opened for direct I/O or when writing to files that are opened with options for synchronized I/O file integrity (O_SYNC/O_DSYNC and equivalents). Sergery Kuksenko is polishing benchmarks that includes this area, this is for a future PR.
> 
> In addition, the blocker mechanism is updated to handle reentrancy (as can happen if debugging code is added to ForkJoinPool) and preemption when compensating (as can happen when substituting a heap buffer with a direct buffer in some I/O operations).  This part is a pre-requisite to the changes to better support object monitor there are more places where preemption is possible and this quickly leads to unbalanced begin/end.
> 
> The changes have been baking in loom repo for some time.

The changes are updated to pin when attempting to increase parallelism. That removes the possibility of preemption in begingBlocking for now so hopefully this is easier to understand. Also removed the transferTo overloads for now, that would make it easier too but we may want to come back to them in the future.

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

PR Comment: https://git.openjdk.org/jdk/pull/18598#issuecomment-2069298348


More information about the core-libs-dev mailing list