RFR: 8284161: Implementation of Virtual Threads (Preview) [v8]

Alan Bateman alanb at openjdk.java.net
Thu Apr 28 07:52:58 UTC 2022


On Wed, 27 Apr 2022 19:43:22 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> Alan Bateman has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Refresh 7965cc6b168e567ac2596f2fbc3b00a7d99b7e1e
>
> src/java.base/share/classes/java/util/concurrent/ThreadPerTaskExecutor.java line 45:
> 
>> 43:  * threads is unbounded.
>> 44:  */
>> 45: class ThreadPerTaskExecutor implements ExecutorService {
> 
> This class manages the set of per-task threads which arguably should be the job of the thread container, and it awkwardly overrides the container's set of threads by setting a field on `SharedThreadContainer.threadsSupplier`.
> 
> `SharedThreadContainer` supports a number of different shared container policies that could be made clearer.
> 
> Architecturally i think this could be better layered but it can be iterated on later.

Indeed, the layering is a bit awkward and I plan to replace it. It came about as a short term solution to avoid double bookkeeping of virtual threads.

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

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


More information about the core-libs-dev mailing list