Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSAPoll has been fixed #33

Closed
axoroll7 opened this issue Aug 14, 2023 · 2 comments
Closed

WSAPoll has been fixed #33

axoroll7 opened this issue Aug 14, 2023 · 2 comments

Comments

@axoroll7
Copy link

(If this issue was already discussed, I am really sorry.)

Since WSAPoll has been fixed in recent Windows 10 versions, could this library use an implementation based on it if the Windows 10 build is recent enough ? Since IOCP seems to suffer from latency, the performances should be better.

• At one time, Google Chrome utilized WSAPoll instead of IOCP. (python-trio/trio#52)
• At one time, IOCP suffered from latency. (python-trio/trio#52)
• WSAPoll fix : "As of Windows 10 version 2004, when a TCP socket fails to connect, (POLLHUP | POLLERR | POLLWRNORM) is indicated." (https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsapoll)

Actually, it just an idea. Some of my informations are not up to date. I don't know if Google Chrome uses WSAPoll today, and how they could use it. I don't know if the latency in IOCP has been fixed. I don't know if WSAPoll is more powerful than IOCP in the real world. Nobody opened an issue about this, and I wanted to know the maintainers's thoughts at this moment, since the popularity of Windows 10 is increasing. Someone could use this idea.

Some things to do for greater insight :
• Look up the Google Chrome source code, to see their method.
• Benchmark IOCP vs WSAPoll on Windows 10 version XXXX.

(English isn't my first language, so please excuse any mistakes.)

@notgull
Copy link

notgull commented Aug 14, 2023

The main issue with WSAPoll is that it takes linear time (O(n)) to run. For hundreds of thousands of sockets this amount of time is noticeable. The value proposition of wepoll is its ability to poll all of these sockets in near constant time (O(1)).

@axoroll7
Copy link
Author

The main issue with WSAPoll is that it takes linear time (O(n)) to run. For hundreds of thousands of sockets this amount of time is noticeable. The value proposition of wepoll is its ability to poll all of these sockets in near constant time (O(1)).

@notgull

Thank you for your explanations !
I don't know why I thought WSAPoll was more like epoll than poll. I surely misread or misunderstand an article on the web.
I checked Chromium and they use IOCP too for TCP and UDP sockets.

I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants