简体   繁体   English

boost :: condition_variable :: notify_one()的行为

[英]Behavior of boost::condition_variable::notify_one()

Does the boost::condition_variable::notify_one() function automatically resume execution of the thread it is unblocking or is that undefined and dependent on how the OS schedules the thread? boost :: condition_variable :: notify_one()函数是否自动恢复正在解除阻塞的线程的执行,或者是否未定义并且取决于操作系统如何调度线程?

I am not all that familiar with threading and how the OS interacts with them so any insight into notify_one()'s implementation would be helpful. 我对线程以及操作系统如何与之交互并不十分熟悉,因此对notify_one()的实现有任何了解。

Thanks 谢谢

Boost doesn't resume, nor schedule anything, it talks to the OS and the OS takes care of multi-tasking. Boost不会恢复,也不会计划任何事情,它会与操作系统进行对话,并且操作系统会负责多任务处理。 The OS will most likely unblock the thread some time in the future; 操作系统很可能在将来的某个时间解除线程阻塞; you could have a real-time OS with guarantees (like "unblocked threads will always start execution within X milliseconds"), but Boost doesn't try to guarantee that. 您可能会有一个带有保证的实时操作系统(例如“无阻塞线程将总是在X毫秒内开始执行”),但是Boost并没有保证这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 boost :: condition_variable :: notify_one()上的并发 - concurrency on boost::condition_variable::notify_one() 是否有用于 std::condition_variable 的 notify_one() 队列? - Is there a `notify_one()` queue for `std::condition_variable`s? std :: condition_variable :: notify_one可重入吗? - Is std::condition_variable::notify_one reentrant? condition_variable::notify_one 不会立即解除阻塞等待? - condition_variable::notify_one does not instantly unblock wait? notify_one 不触发动态库中的condition_variable - notify_one not triggering condition_variable inside dynamic library std::condition_variable wait() 和 notify_one() 同步 - std::condition_variable wait() and notify_one() synchronization 为什么 std::condition_variable::notify_one 阻塞? - why is std::condition_variable::notify_one blocking? 如果有很多线程在等待通知,std::condition_variable::notify_one() function 通知哪一个? - If there are many threads are waiting to be notify, which one does the std::condition_variable::notify_one() function notify? 为什么在 std::condition_variable 中,notify_all 比 notify_one 工作得更快(在随机请求上)? - Why in std::condition_variable notify_all works faster than notify_one (on random requests)? std :: condition_variable的notify_all()和notify_one()有什么区别? - What's the difference between notify_all() and notify_one() of std::condition_variable?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM