-
Notifications
You must be signed in to change notification settings - Fork 42
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
refactor: simplify attach logic #200
refactor: simplify attach logic #200
Conversation
Need a multi threaded benchmark to check if there's any performance regression. |
Win32 event may not reliable. I'll try CondVar |
This PR proposes a new feature While |
b6bc143
to
0cd0a67
Compare
3b14a28
to
837dc3f
Compare
709b86b
to
d293b27
Compare
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.
LGTM
Remove the channel and wait for the spawned task directly.
d293b27
to
b039ac5
Compare
io-uring and polling both allow an IO source being registered with multiple drivers, while IOCP doesn't allow that. Internally, IOCP handle is recorded inside the file handles and socket handles;
try_clone
only increases the reference count of the file/socket handle, which means IOCP handle still remains the same. Therefore, one IO handle can only be attached to one IOCP handle.If we want to send the IO source to other threads, we must be very careful to make sure the handles have not been attached. That's what
Unattached
for. It is too complicated to use.This PR spawns a global thread to query IOCP. The thread checks the driver id and wake up the complete one. This synchronization is backed by win32 Event. Should point out that win32 Event could not be used directly in GUI thread, because it would block the message loop; but it is also not encouraged to perform IO in the GUI thread:)
Closes #202