pthread_ cond_ Which thread will signal?

When a thread calls pthread_ cond_ Signal(), unix network programming says pthread_ cond_ Signal () is just that nofit has only one thread because it is not a pthread_ cond_ broadcast(). This means that there are no competitive conditions However, this book does not specify which subject will be notified and how Does this function wake up threads randomly?

Solution

Straight from the man:

"Scheduling policy" is the order determined by the operating system This is one of the four listed in the link below, but you really don't know (at least not some impressive hacker) which is "first" It doesn't matter - all threads waiting for conditions should be ready to continue as well - otherwise you'll have design problems

Scheduling policies in Linux kernel discusses some Linux strategies. If it is important, you can Google from there

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>