-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add tryAcquire to GpuSemaphore #10330
Conversation
Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
61b36d9
to
337e060
Compare
build |
@@ -245,6 +259,30 @@ private final class SemaphoreTaskInfo() extends Logging { | |||
} | |||
} | |||
|
|||
def tryAcquire(semaphore: Semaphore): Boolean = synchronized { |
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.
Do you think there are some smarter heuristics to be had if we return the number of waiters when the semaphore cannot be acquired via Either[Int,Boolean]
?
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuSemaphore.scala
Outdated
Show resolved
Hide resolved
sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuSemaphore.scala
Outdated
Show resolved
Hide resolved
build |
@jlowe and @gerashegalov please take another look |
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.
LGTM
Signed-off-by: Robert (Bobby) Evans <bobby@apache.org>
This fixes #10261