-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Enhance virtual thread support #1724
base: main
Are you sure you want to change the base?
Conversation
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupport.scala
Outdated
Show resolved
Hide resolved
# When set to `on` but underlying runtime does not support virtual threads, an Exception will throw. | ||
# Virtualize this dispatcher as a virtual-thread-executor | ||
# Valid values are: `on`, `off` | ||
virtualize = off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
behind an option
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala
Outdated
Show resolved
Hide resolved
262b627
to
fc2f4d7
Compare
actor/src/main/scala/org/apache/pekko/dispatch/VirtualThreadSupportReflect.scala
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be written using MethodHandles. #1724 (comment)
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@pjfanning I took another look at vert.x, which is using reflection too, let's move fast and ship it as this, and then in 2.0.0, we can drop Java 8 completely, I'm doing this in my free time, I don't like over-engineering. Especially with the current problem of #1729, so It can only be tested in a separate cycle. I will leave it as it is now, I vote for shipping it as it is in 1.2.0 and then we move to Java 11 in 2.0.x, btw, there are many reflections in the current codebase too. |
@pjfanning If you are worried about the |
|
We are doing that at $Work (a trust env), but it's not a good choice for open-sourcing work, where people will have their modules opened unexpectedly. Maybe a configuration with JPMSUtils seems fine, but that's another story that lives in another PR. |
621f209
to
ebb3bbd
Compare
Can't, will need a
No, if and only if a user turns on the People should use the current |
Motivation:
Enhances the current virtual thread support which can switch the virtual threads' scheduler.
Modification:
Use the method handle to change the scheduler of virtual threads.
CarrierThread
Result:
Virtualization with virtual threads supported.
We have a user case at $Work, where we are pulling data from a blocking API, With this, I think we can then decrease the Threads number.
based on #1734