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

Async doesn't work on Windows #131

Open
AmjadHD opened this issue Jul 31, 2022 · 6 comments
Open

Async doesn't work on Windows #131

AmjadHD opened this issue Jul 31, 2022 · 6 comments

Comments

@AmjadHD
Copy link
Contributor

AmjadHD commented Jul 31, 2022

After #125 fix of #121, async doesn't work on Windows. Isn't there a way to make it work ?

@PMunch
Copy link
Owner

PMunch commented Aug 7, 2022

@bung87, if these aren't fixed soon I'll have to revert your changes..

@bung87
Copy link
Contributor

bung87 commented Aug 7, 2022

I dont understand , the issue seems like a question, my pr does work on windows . I dont see any reason async support cause code revert.

@bung87 bung87 mentioned this issue Aug 9, 2022
@AmjadHD
Copy link
Contributor Author

AmjadHD commented Aug 10, 2022

What I meant is async doesn't work on windows like other platforms, #121 was fixed by not going async on windows.

nimlsp/src/nimlsp.nim

Lines 665 to 673 in 7b28d0c

when defined(windows):
var
ins = newFileStream(stdin)
outs = newFileStream(stdout)
main(ins, outs)
else:
var
ins = newAsyncFile(stdin.getOsFileHandle().AsyncFD)
outs = newAsyncFile(stdout.getOsFileHandle().AsyncFD)

This issue is more of a continuation to #121 to discuss how async can be implemented on windows.
So I don't see how #132 fixes this.

@bung87
Copy link
Contributor

bung87 commented Aug 10, 2022

oh, sorry! it's fix #130, I understand the problem you want to resolve. I've investigate one or two years ago , this is because std async libs use iocp , but it will not work on stdio, see https://stackoverflow.com/questions/55619555/win32-impossible-to-use-iocp-with-stdin-handle , I'v read one blog post by tokio explain more details, but I can't find the link now.

@AmjadHD
Copy link
Contributor Author

AmjadHD commented Aug 15, 2022

@bung87
Copy link
Contributor

bung87 commented Aug 16, 2022

yeah, it's that post.

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

3 participants