你什么时候会调用java的thread.run()而不是thread.start()? [英] When would you call java's thread.run() instead of thread.start()?
本文介绍了你什么时候会调用java的thread.run()而不是thread.start()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你什么时候会调用 Java 的 thread.run()
而不是 thread.start()
?
When would you call Java's thread.run()
instead of thread.start()
?
推荐答案
您可能希望在严格关注功能而非并发性的特定单元测试中调用 run().
You might want to call run() in a particular unit test that is concerned strictly with functionality and not with concurrency.
这篇关于你什么时候会调用java的thread.run()而不是thread.start()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文