Closed tiif closed 2 weeks ago
@rustbot ready
Don't our existing tests already cover this case? I added a comment along those lines:
The test is not very clear about the fact that that is what it tests, though.
Ah I guess this is a different aspect of "edge semantics".
Ah I guess this is a different aspect of "edge semantics".
Yup it's different. The non-blocking test checks "if no event occurs between two epoll_wait calls, we should not receive any notification during the second epoll_wait". The test in this PR checks "if multiple threads are blocking on the same epoll fd, a single notification on that epoll fd should wake up only one thread (the alternative would be waking up all threads, i.e. thundering herd behaviour )"
I forgot how the implementation works and was wondering how the assumption here is being upheld. So I wrote a test.
https://github.com/rust-lang/miri/blob/9d9da34f49562bbe78e09213ee6e8aa9b9db1cce/src/shims/unix/linux/epoll.rs#L541-L542
This is mainly written for me to verify if it actually works, so it is perfectly ok to not merge this.