-
Notifications
You must be signed in to change notification settings - Fork 62
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
Implement event loop based on QNX ionotify #669
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #669 +/- ##
==========================================
- Coverage 80.39% 80.04% -0.35%
==========================================
Files 28 28
Lines 5992 6048 +56
==========================================
+ Hits 4817 4841 +24
- Misses 1175 1207 +32 ☔ View full report in Codecov by Sentry. |
That's a lot of conditional compilation. Is that intended to be final? |
Short answer: it's totally possible to completely remove all these compile-time conditions from existing sources. Now, some details.
To be honest, I want to keep all these checks, because otherwise every fix to posix implementation or socket_channel should be duplicated in the qnx implementation. Apart from this, do you think it's a viable solution to add feedback functionality to I/O events? |
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.
Some quick Initial feedback:
The conditional compilation should be removed from the headers and source. We dont have any backwards compatibility guarantees with the C libraries across different versions.
Additionally, I'm really concerned about the massive duplication between the qnx and posix folders from a maintainability standpoint.
static int s_run(struct aws_event_loop *event_loop) { | ||
struct ionotify_loop *ionotify_loop = event_loop->impl_data; | ||
|
||
AWS_LOGF_INFO(AWS_LS_IO_EVENT_LOOP, "id=%p: Starting event-loop thread.", (void *)event_loop); |
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.
Don't do it here, but this reminds me that I think we need to start tagging event loop logging with event loop type (iocp, kqueue, epoll, gcd, inotify) for easier disambiguation, especially if some platforms might have multiple types available (mac eventually)
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.
I can actually introduce a new subject, AWS_LS_IO_EVENT_LOOP_IONOTIFY - "event-loop-ionotify"
. It won't take much effort. Unless you have something else in mind, then I'll leave it as is.
AWS_LOGF_TRACE(AWS_LS_IO_EVENT_LOOP, "id=%p: fd is writable", (void *)event_loop); | ||
event_mask |= AWS_IO_EVENT_TYPE_WRITABLE; | ||
} | ||
if (pulse->value.sival_int & _NOTIFY_COND_EXTEN) { |
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.
Under what circumstances would this happen and what does it mean? All we seem to do is log it.
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.
Oh, this one is tough. I added a comment describing my interaction with this flag. I suggest we keep this log, maybe it'll reveal something.
Implement CRT event loop based on QNX event mechanism.
aws_io_handle
struct. This callback is called by I/O operations to provide results to event loop. For backward compatibility, it is hidden by ifdef constructions.ionotify
, a special function provided by QNX to handle I/O events, to implement CRT event loop.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.