Skip to content
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

Loom support. #1176

Merged
merged 17 commits into from Jan 5, 2023
Merged

Loom support. #1176

merged 17 commits into from Jan 5, 2023

Conversation

yschimke
Copy link
Collaborator

@yschimke
Copy link
Collaborator Author

yschimke commented Dec 31, 2022

@swankjesse Are there any benchmarks we can test

  • master
  • yschimke:loom on JDK 9
  • yschimke:loom on JDK19 with loom enabled.

@yschimke
Copy link
Collaborator Author

TODO

  • add a CI build against Loom
  • test with -Djdk.tracePinnedThread=full

@@ -253,7 +259,7 @@ open class AsyncTimeout : Timeout() {
prev.next = node
if (prev === head) {
// Wake up the watchdog when inserting at the front.
(AsyncTimeout::class.java as Object).notify()
condition.signal()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

while (true) {
val now = System.nanoTime()
val byteCountOrWaitNanos = byteCountOrWaitNanos(now, byteCount)
if (byteCountOrWaitNanos >= 0) return byteCountOrWaitNanos
waitNanos(-byteCountOrWaitNanos)
}
}
throw AssertionError() // Unreachable, but synchronized() doesn't know that.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

Copy link
Member

@swankjesse swankjesse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love where you’re going with this.

Please take the next steps:

  • replace synchronized with withLock
  • tests for the function on Timeout

@yschimke yschimke changed the title [Experiment] Loom support. Loom support. Jan 2, 2023
@yschimke yschimke marked this pull request as ready for review January 2, 2023 09:28
import java.util.concurrent.ScheduledExecutorService
import java.util.concurrent.ThreadFactory

object TestingExecutors {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rad

yschimke and others added 6 commits January 5, 2023 09:10
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
Co-authored-by: Jesse Wilson <jwilson@squareup.com>
@yschimke yschimke merged commit f8434f5 into square:master Jan 5, 2023
@yschimke yschimke mentioned this pull request Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants