linux下有和windows下的WaitForMultObjects同样功能的API吗?(除了select,poll之类的)
巴扎黑
巴扎黑 2017-04-17 13:12:03
0
2
665

windows的同步对象都是用句柄来表示,所以,WaitForMultObjects可以等待多个句柄signal,并且最多的功能是等待N个句柄里的某一个,并且进行对应的处理。

linux下有select,poll之类的来进行对多个socket或者文件进行监听,但是不能等待多个mutex,而条件变量和mutex的组合的模式又不一样。

简单的问题就是,linux多个线程,每个线程可以同时等待多个对象,并且达到同步的效果吗?

巴扎黑
巴扎黑

reply all(2)
迷茫

No, consider other options.

PHPzhong

The final conclusion is that Linux really cannot implement the system-level function of waiting for multiple objects.
Interested students can take a look at this discussion http://www.newsmth.net/bbstcon.php?board=LinuxDev&gid=59182&st...

ps, there are so few people using Linux C here

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!