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

Use SetFileCompletionNotificationModes when attaching. #83

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

Berrysoft
Copy link
Member

Some IO methods may success immediately. However, it will also issue a packet to IOCP. Now in #82 we've allowed success immediately in push, so it is possible to handle these methods, and disable the packet issue.

We can disable the inner event handle of file object as well. It may improve the performance a little.

Reference

https://learn.microsoft.com/en-US/troubleshoot/windows/win32/asynchronous-disk-io-synchronous

https://devblogs.microsoft.com/oldnewthing/20190719-00/?p=102722

https://devblogs.microsoft.com/oldnewthing/20200221-00/?p=103466

dotnet/corefx#15141

@Berrysoft Berrysoft added the driver: IOCP About the IOCP driver label Oct 5, 2023
@Berrysoft Berrysoft requested review from bdbai and removed request for George-Miao October 5, 2023 16:24
@Berrysoft
Copy link
Member Author

Berrysoft commented Oct 5, 2023

It seems that some IO futures return Ready on first call to Future::poll.

@Berrysoft
Copy link
Member Author

SetFileCompletionNotificationModes is in OneCoreUAP, which means it could be used in UWP.

@Berrysoft
Copy link
Member Author

Berrysoft commented Oct 6, 2023

There are some notes:

  • This method doesn't work if the user doesn't use an IFS LSP. It seems still to be a problem in 2017. internal/poll: crash setting file completion modes on Windows golang/go#22149
  • dotnet says that this method shouldn't be used in UWP. We need to confirm. Update: dotnet removed this limitation.
  • Go only enables this for TCP sockets. The reason why not udp is removed; the reason why not file handle seems nonsense.

@Berrysoft
Copy link
Member Author

LSP is deprecated. I think we can just ignore them at now.

@Berrysoft Berrysoft merged commit f1a5192 into compio-rs:master Oct 6, 2023
11 checks passed
@Berrysoft Berrysoft deleted the dev/skip-port-on-success branch October 6, 2023 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver: IOCP About the IOCP driver
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants