-
Notifications
You must be signed in to change notification settings - Fork 341
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 basic epoll support #3448
Comments
Note that this does not require #3449, and doesn't run into the complications mentioned there regarding Miri becoming itself an async runtime. Miri can internally implement an operation blocking on N different things just fine, as long as those things are all events Miri completely controls (like socketpair and eventfd where Miri knows exactly when they are unblocked). We "just" need to find a good way to structure this so it does not become messy and can scale to more types of FDs. |
Hi, I am going to work on this as potential GSoC project. Since |
@rustbot claim |
This is the proposal for |
Implement epoll shim This PR: - implemented non-blocking ``epoll`` for #3448 . The design for this PR is documented in https://hackmd.io/`@tiif/SJatftrH0` . - renamed FileDescriptor to FileDescriptionRef - assigned an ID to every file description
The epoll API mainly consists of epoll_create1, epoll_ctl, and epoll_wait. We have basic shims for all these functions but currently our epoll support is mostly a stub, since the actual polling part is still missing. (Also the behavior of
dup
on an epoll file descriptor is likely wrong.)Implementing this is non-trivial, since it introduces a new kind of blocking to Miri: block until any of a set of FDs is read for reads/writes. We currently don't have any notion of file descriptors blocking at all, so this will need some careful design We probably need some notion of a per-file-descriptor wait lists of threads that are blocked on this FD? We should probably have eventfd and socketpair implemented first so that we have some examples of blocking FDs to consider.
Also note some interesting tidbits in this SO question: we may have to explicitly implement the concept of a file description as that seems to be observable through the epoll APIs. On the plus side this means we can implement
dup
once and for all and we don't have to rely on each and every FD type doing it correctly.The text was updated successfully, but these errors were encountered: