Home  >  Q&A  >  body text

linux下有和windows下的WaitForMultObjects同样功能的API吗?(除了select,poll之类的)

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

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

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

巴扎黑巴扎黑2741 days ago671

reply all(2)I'll reply

  • 迷茫

    迷茫2017-04-17 13:14:03

    No, consider other options.

    reply
    0
  • PHPz

    PHPz2017-04-17 13:14:03

    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

    reply
    0
  • Cancelreply