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

Raise the number of file handles on Windows #98921

Merged
merged 1 commit into from
Nov 29, 2024

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Nov 7, 2024

This raises the number to the maximum value according to the docs, which is 8192. The default is 512.

This should avoid many file access errors that happen in big projects during heavy operations dealing with many resources.

A better fix woul be to rewrite FileAccessWindows so it uses the Win32 API directly. However, this already brings value.

I think both MSVC and MinGW support this. MSVC does for sure. Let's see what CI thinks about MinGW.

@RandomShaper RandomShaper added enhancement platform:windows cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 7, 2024
@RandomShaper RandomShaper added this to the 4.4 milestone Nov 7, 2024
@RandomShaper RandomShaper requested a review from a team as a code owner November 7, 2024 11:16
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Raising the limit is a win, assuming the change doesn't break anything.

@AThousandShips AThousandShips changed the title Raise the amount of file handles on Windows Raise the number of file handles on Windows Nov 8, 2024
@akien-mga akien-mga requested a review from bruvzg November 29, 2024 14:50
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think both MSVC and MinGW support this.

MinGW implementation seems to be dummy, so relevant only for MSVC. But should not break anything.

https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-crt/stdio/_setmaxstdio.c

A better fix woul be to rewrite FileAccessWindows so it uses the Win32 API directly. However, this already brings value.

This is likely a better option.

@akien-mga akien-mga merged commit c2f19e9 into godotengine:master Nov 29, 2024
20 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release enhancement platform:windows topic:porting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants