RFR: Support yield on virtual thread on EPollSelector select() [v2]

joeyleeeeeee97 duke at openjdk.java.net
Thu Apr 28 08:48:49 UTC 2022


On Thu, 28 Apr 2022 07:53:55 GMT, Ron Pressler <rpressler at openjdk.org> wrote:

>> joeyleeeeeee97 has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>> 
>>   Support yield on virtual thread on EPollSelector select()
>
> Virtual threads are designed to [help application throughput by allowing thousands of threads](https://openjdk.java.net/jeps/425) (or more). Since you're interested in polling on virtual threads, could you explain the use-case for I/O polling on thousands of threads?

@pron Thanks for your attention.
I assume the optimal solution with IO in loom is using thousands of threads with blocking IO operation, and another layer of I/O polling upon default `Read/Write Poller` is theoretically redundant. But current frameworks need time to evolve.

The main reason for supporting polling is `compatibility` for reactor based current frameworks and users.

For example without this support users are required to update their network framework to a `loom targeted version`(if that work has been done) to achieve the best performance(**The optimized column in benchmark results**), and what if their production is required to work on lower version JDKs?  In that case, they have to maintain a `loom branch` for best performance.

Overall, I think this will make users benefit more loom easier. 

> ```
> +------------------------------------------------------------------------------------+
> |                       Type: plaintext, Result: totalRequests                       |
> +----------+---------+-------------------+-----------------+-------------------------+
> | pipeline |  spring | spring-virtualbiz | spring-virtual  | spring-virtualoptimized |
> +----------+---------+-------------------+-----------------+-------------------------+
> |    4     | 1105401 |      1146776      |     1219481     |         1233398         |
> |    8     | 1304546 |      1313621      |     1234331     |         1406274         |
> |    16    | 1465894 |      1474328      |     1245648     |         1520790         |
> +----------+---------+-------------------+-----------------+-------------------------+
> ```

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

PR: https://git.openjdk.java.net/loom/pull/166


More information about the loom-dev mailing list