由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - what is the use of thread.yield()?
相关主题
线程问题。implements runable 和 extends thread
另一个入门问题。java的接口runnable
再问一个今天的面试题请问关于用threadPoolExecutor实现threadpool的问题?
FrameWork of Thread application 1java ,wait ,notify notifyall
ZT: 关于性爱的多线程问题研究(一)一道java题
问个Thread 的问题,java certificate里的NoThread concurrency
Can Java thread return a value?好虫,exploit等大牛请进--关于htmlunit
能这么 create thread 吗?core java多线程一般面试什么
相关话题的讨论汇总
话题: what话题: use话题: yield话题: thread话题: runnable
进入Java版参与讨论
1 (共1页)
e***a
发帖数: 1661
1
what is the use of thread.yield()?
a******n
发帖数: 5925
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.
1 (共1页)
进入Java版参与讨论
相关主题
core java多线程一般面试什么ZT: 关于性爱的多线程问题研究(一)
ThreadLocal 的一个 use case问个Thread 的问题,java certificate里的
请教一个多线程的问题Can Java thread return a value?
What are the key benefits of the EJB technology?能这么 create thread 吗?
线程问题。implements runable 和 extends thread
另一个入门问题。java的接口runnable
再问一个今天的面试题请问关于用threadPoolExecutor实现threadpool的问题?
FrameWork of Thread application 1java ,wait ,notify notifyall
相关话题的讨论汇总
话题: what话题: use话题: yield话题: thread话题: runnable