We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在await时,能否添加自旋,减少waiter的上线文切换 ?
nanos = deadline - System.nanoTime(); if (nanos <= 0L) { // 设置超时, 阻塞当前线程(阻塞指定时间) removeWaiter(q); return state; } LockSupport.parkNanos(this, nanos);
如果等待时间过短,比如小于1000ns ,那么上下文的切换没有必要。此处请参考Guava 23 的实现。 com.google.common.util.concurrent.AbstractFuture#get(long, java.util.concurrent.TimeUnit) 另外 System.nanoTime() 有可能返回0
com.google.common.util.concurrent.AbstractFuture#get(long, java.util.concurrent.TimeUnit)
The text was updated successfully, but these errors were encountered:
https://github.com/fengjiachun/Jupiter/issues/44
8a6750b
;-)
Sorry, something went wrong.
eb972d2
No branches or pull requests
在await时,能否添加自旋,减少waiter的上线文切换 ?
如果等待时间过短,比如小于1000ns ,那么上下文的切换没有必要。此处请参考Guava 23 的实现。
com.google.common.util.concurrent.AbstractFuture#get(long, java.util.concurrent.TimeUnit)
另外 System.nanoTime() 有可能返回0
The text was updated successfully, but these errors were encountered: