Skip to content

VirtualThread(s) context lookup relies on ThreadLocal(s) #5817

@franz1981

Description

@franz1981

Version

latest 5.x and 4.x

Context

https://github.com/eclipse-vertx/vert.x/blob/master/vertx-core/src/main/java/io/vertx/core/impl/VertxImpl.java#L101-L104 shows that while creating virtual threads from other virtual threads we would use ThreadLocal(s) - which is a bad pattern due to the heavyweight nature of TL w Loom.
See netty/netty#13191 and quarkusio/quarkus#39696
There are few option(s) here:

IDK how to better fix it, since it's purpose is to propagate the context (see

ContextDispatch current = nonVertxContextDispatch.get();
), but we can think of a better and more performant way for sure.

Steps to reproduce

No response

Do you have a reproducer?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions