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

Enforced async I/O when opening a SystemFile #58

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

itsWindows11
Copy link
Contributor

By default, the stream returned from File.Open does synchronous operations on the file. We can make the underlying operating system give us an asynchronous file stream to do true async reads/writes.

By default, the stream returned from `File.Open` does synchronous operations on the file. We can make the underlying operating system give us an asynchronous file stream to do true async reads/writes.
@Arlodotexe
Copy link
Owner

For our purposes, we should fix this because when synchronous (default) is set, there's no cancellation support on the async methods of FileStream. I hadn't noticed that before, maybe I need to add CommonTests for this.

Additionally, there's a lot of sync and async-specific optimizations done to improve performance, so many that they're using the strategy pattern in the dotnet implementation of FileStream. We should definitely expose this flag on SystemFile, but this can be done in a different ticket.

@Arlodotexe Arlodotexe merged commit 9000c06 into Arlodotexe:main Jun 20, 2024
1 check passed
@itsWindows11 itsWindows11 deleted the imp/async-filestream branch June 20, 2024 21:45
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

Successfully merging this pull request may close these issues.

2 participants