Skip to content

Why is there an option to enable virtual threads in ThreadPoolTaskExecutor? #34758

Closed as not planned
@peter-cheon

Description

@peter-cheon

Hello,
From what I understand, virtual threads are structurally designed in a way that doesn't require a thread pool.
However, despite this, ThreadPoolTaskExecutor has added an option to enable virtual threads.

I had assumed that when virtual threads are enabled, settings like core pool size, max pool size, and queue capacity wouldn't be used.
But it seems that even when virtual threads are enabled, those configurations are still being utilized in some way.
Looking into the code, it appears that a virtual thread can be injected into the ThreadFactory of Java’s ThreadPoolExecutor.

I'm curious about the intention behind this. Was it designed to allow virtual threads to be used like a thread pool?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.comstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions