-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Windows: Event loop based on IOCP #12149
Windows: Event loop based on IOCP #12149
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
class OverlappedOperation | ||
enum State | ||
INITIALIZED | ||
STARTED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my first implementation, I enqueued the OverlappedOperation
inside the start
method. For this, I needed a separate state STARTED
for this. This is no longer required since the enqueuing only happens when the operation is cancelled.
I think STARTED
could be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I believe there can be some more refactoring of the state. But I'd leave it as is for now and do that in a follow-up later. The current code is working and I'd prefer to get it into master soon and then work on improving it further.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
They're here - #12146 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two improvements for the future:
- The pending spec.
- A bit of comments to help understand the needed pointer arithmetic (or a patch that avoids it, if there can be such thing).
But let's get it rolling 🚀 Thanks ppl for solving this important issue! 🙇
@@ -191,7 +191,7 @@ describe "select" do | |||
x.should eq 2 | |||
end | |||
|
|||
it "stress select with send/receive in multiple fibers" do | |||
pending_win32 "stress select with send/receive in multiple fibers" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR in theory nothing is preventing this to work, all of the ingredients are there, but it's still failing.
(PS: I'm adding to the 1.5 milestone even when we're in the freeze period because it doesn't affect any of the supported platforms) |
Guys, I know this is a work page (and a closed one), but my dudes take a moment to pat yourselves on the pat, because you beautiful maniacs deserve that pat on the back. We're now one step closer to being able to use my favorite language, anywhere its needed. And thats a glorious thing. Thankyou! |
This patch implements the event loop for windows, based on IOCP. It follows up on #10784 which introduced overlapped operations.
It consists of:
.\bin\crystal spec .\spec\std\socket\
Cudos to @wonderix for digging into this and finding the flaw in how we used the Win32 API, with thanks to @yxhuvud and @HertzDevil for helping out along the way (see discussion in #11776). Thanks to @neatorobito who laid the groundwork in #9957, as well as @kubo and @cfsamson for their input in #6957. 🙇
Digging through all these discussions shows it's been a long road.
But it looks like we now have a pretty much functional event loop on Windows 🚀
Closes #9957
Closes #11776