a*n
2 楼
考试书上抄来的
What yield() is supposed to do is
make the currently running thread head back to runnable to allow other
threads of
the same priority to get their turn. So the intention is to use yield() to
promote
graceful turn-taking among equal-priority threads. In reality, though, the
yield()
method isn't guaranteed to do what it claims, and even if yield() does cause
a
thread to step out of running and back to runnable, there's no guarantee the
yielding
thread won't just be chosen again over all the others! So while yield()
might—and
often does—make a running thread give up its slot to another runnable
thread of the
same priority, there's no guarantee.
What yield() is supposed to do is
make the currently running thread head back to runnable to allow other
threads of
the same priority to get their turn. So the intention is to use yield() to
promote
graceful turn-taking among equal-priority threads. In reality, though, the
yield()
method isn't guaranteed to do what it claims, and even if yield() does cause
a
thread to step out of running and back to runnable, there's no guarantee the
yielding
thread won't just be chosen again over all the others! So while yield()
might—and
often does—make a running thread give up its slot to another runnable
thread of the
same priority, there's no guarantee.
相关阅读
感觉匿名类值得好好研究一下谁搞过machine learning?zkssnetflix的用hdtv看它的电影,如果1000用户同时登录看同一个影片,怎么处理的?最近公司在推vagarant vmjava update main UI from child thread issue新手学Java 求建议Java StringBuilder myth debunked现在就业市场很光明啊把photoshop文件PSD 转换成 HTML流行吗?大牛们说说guava用的广泛吗?向各位朋友请教一道题目向能人请教verawang.com 的网站样式,目前好像很流行。等HADOOP2.0的稳定版本出来之后就上马ActiveMQ和RabbitMQ多线程真头疼,但也挺有趣Java支持placement new吗?硅谷十年Java能有20万吗?Eclipse 做得很好flex virgo