ruby-prof“等等”结果栏中:这是什么?
ruby-prof 输出的结果始终包含“等待”列的值。然而,我从来没有找到这个值的描述,并且在我使用 ruby-prof 的所有时间里,我从未见过该列采用 0 以外的值。
这个值应该代表什么?任何帮助将不胜感激。谢谢!
The results for the ruby-prof output always contains a value for the "Wait" column. However, I've never found a description of what this value is and in all the times I've used ruby-prof, I've never seen this column ever take on a value other than 0.
What is this value supposed to represent? Any help would be appreciated. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
等待列告诉我们线程必须等待多长时间,也就是它等待其他线程花费的时间。
本质上,线程会等待当前正在被另一个线程使用的资源。一旦该线程使用完该资源,它将通知其他线程该资源已准备好使用。
要了解有关 Ruby 多线程的更多信息,请查看:
http://www .ruby-doc.org/docs/ProgrammingRuby/html/tut_threads.html
请记住,这个等待概念不仅适用于 Ruby,而且是多线程中的一个巨大概念。
The wait column tells us how long a thread had to wait, aka how long it spent waiting for other threads.
Essentially a thread would wait for a resource that is currently being used by another thread. Once that thread is done with that resource, it would notify the other threads that the resource is ready to be used.
To read more on multi threading with Ruby, check out:
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_threads.html
Keep in mind, this wait concept is not only for Ruby, but is a huge concept in multi threading.