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

Question for the implementation of reading a file. #28

Open
lch32111 opened this issue Oct 15, 2024 · 1 comment
Open

Question for the implementation of reading a file. #28

lch32111 opened this issue Oct 15, 2024 · 1 comment

Comments

@lch32111
Copy link

Thank you for sharing your awesome work of reading obj data quickly!
I am referring to your implementation for my game engine.

While reading your implementation, I was curious about why you replaced the aio with readahead+pread64 on the linux platform.
Could you share anything about this? I have little experience on this kind of topic.

Thanks.

@lch32111
Copy link
Author

I think that you are using a wrong variable for GetOverlappedResult here:

bool success = GetOverlappedResult(m_handle, &m_overlapped, &bytes_read, TRUE);

m_handle is the Event object created like this:

m_handle = CreateEventA(nullptr, FALSE, FALSE, nullptr);

According to MSDN, the first parameter of GetOverlappedResult should be a handle to the file, named pipe, or communication device. You can also find an example from here.

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

1 participant