TMonitor.Pulse vs TMonitor.PulseAll

时光毁灭记忆、已成空白 提交于 2019-12-05 09:17:40

In a traditional producer/consumer queue, each consumer thread takes one item off the queue. When you enqueue a single item you only need to wake up a single consumer thread. Since any of the consumer threads can handle the task, it does not matter which one is woken up, so long as one is. Thus a call to Pulse() rather than PulseAll() suffices.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!