select() 与 WSAEventSelect() 与 WSAWaitForMultipleEvents() 之间的性能差异
我有一个使用内部开发的跨平台库的应用程序。 由于各种原因,我必须至少在 Windows 下坚持使用这个库。
该库包含一个我必须使用的套接字类,它正在调用 select。
我有能力稍微修改一下库。 如果使用 WSAWaitForMultipleEvents 或 WSAEventSelect 是否会提高性能?
请记住,客户端库基于阻塞 I/O。
即它在发出recvfrom之前首先调用select来检查读取,写入也是如此。
从我所看到的来看,有相当多的设置只是为了选择,并且想知道我是否可以通过使用 Windows 本机版本来提高轮询速度,因为我的基于 Linux 的 UDP 服务器偶尔会压垮我的接收器,从而导致其停顿。即接收者虽然没有做很多事情,但很难跟上。增加接收缓冲区有很大帮助,但现在我正在考虑选择。
I have an application that is using a cross platform library developed internally.
For various reasons I must stick with using this library under windows at least.
That library contains a socket class that I have to use and it's calling select.
I have the ability to modify the library a little.
Would there be a performance improvement if going to WSAWaitForMultipleEvents or WSAEventSelect?
Bear in mind that the client library is based on a blocking I/O.
i.e. it calls select to check read first before issuing recvfrom, and the same for writing.
From what I can see there is quite a lot of set up just for select and wondered if I might improve the polling speed by going to the windows native versions as my UDP server which is linux based is occasionally overwealming my receiver which stalls it. i.e. the receiver while not doing a lot has trouble keeping up. Increasing the receive buffers has helped enormously but now I'm looking at select.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论