Skip to content

Use a virtual thread as the default blocking task executor if Project Loom is available #4911

@ikhoon

Description

@ikhoon

If Project Loom is activated on the JRE, we may use Thread.ofVirtual().factory() to create virtual threads for BlockingTaskExecutor instead.

final ThreadFactory threadFactory = ThreadFactories.builder(threadNamePrefix)
.daemon(daemon)
.priority(priority)
.taskFunction(taskFunction)
.build();

Virtual threads require a small number of threads. Users will have less work to tune thread counts with less memory footprint.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions