compio-rs / compio

A thread-per-core Rust runtime with IOCP/io_uring/polling.
MIT License
420 stars 37 forks source link

Use SetFileCompletionNotificationModes when attaching. #83

Closed Berrysoft closed 1 year ago

Berrysoft commented 1 year ago

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

https://github.com/dotnet/corefx/pull/15141

Berrysoft commented 1 year ago

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

Berrysoft commented 1 year ago

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

Berrysoft commented 1 year ago

There are some notes:

Berrysoft commented 1 year ago

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