-
Notifications
You must be signed in to change notification settings - Fork 185
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
Java 21 virtual threads #398
Conversation
Can you please separate out the switch to java 21? |
Looks like this needs to come after #399 as well. |
d2f2da7
to
0d098e6
Compare
I'm sorry, that is my fault. I've just pushed clean branch now. |
@@ -87,6 +87,11 @@ public static void main(String[] args) throws Exception { | |||
intervalMonitor = Integer.parseInt(argsLine.getOptionValue("im")); | |||
} | |||
|
|||
Boolean useVirtualThreads = false; | |||
if (argsLine.hasOption("vt")) { |
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.
Can you add a long form --virtual-threads
option as well?
Please also make sure the --help
output is updated.
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.
Ouch, I forgot to add the option at all. Done now:
usage: benchbase
...
-vt,--virtual-threads <arg> Use virtual threads instead of real
threads
eb98c6e
to
bb2136f
Compare
@eivanov89 #416 and others made a bunch of changes to the repo at large. Can you please rebase against and updated If you're using the devcontainer for development, you'll probably want to rebuild it too. |
bb2136f
to
ea4ae0c
Compare
@bpkroth sure, pushed the rebased branch. |
Looks like it's still got conflicts listed. Also, can you please think about a way to add tests for this feature? |
ea4ae0c
to
0ad9d4d
Compare
I'm sorry for this. Forgot that my main is fork's main :) This time, did the proper rebase.
Unfortunately I don't have enough time to work on this further. Also, the feature depends on DB client implementation. For example, I use postgres + c3p0 patch + vthreads. There was a deadlock:
Your vanilla postgres impl should work though. I fixed our version by adding a sessions semaphore (waiting on it doesn't block carrier thread), so that c3p0 never calls |
Sounds good. We're happy to take a PR for both, but it's always good to have a test associated with new features to make sure we continue to support them in the future and they don't break existing functionality. |
I had missed the point, that there are a lot of synchronized inside the benchmark, which should be rewritten at first. |
This patch adds an option "vt" to use virtual threads instead of real OS threads (#395).