-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Labels
A-concurrencyArea: affects our concurrency (multi-thread) supportArea: affects our concurrency (multi-thread) supportA-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement
Description
In eventfd, we would unblock multiple threads in a deterministic sequence. In epoll, we always choose the thread id from the end of the list if multiple threads are blocked on the same epoll instance. We could randomize these operation depending on the seed.
Related FIXME:
miri/src/shims/unix/linux/eventfd.rs
Lines 226 to 229 in 9d9da34
| // FIXME: We can randomize the order of unblocking. | |
| for thread_id in waiting_threads { | |
| ecx.unblock_thread(thread_id, BlockReason::Eventfd)?; | |
| } |
miri/src/shims/unix/linux/epoll.rs
Lines 549 to 555 in 9d9da34
| // FIXME: We can randomly pick a thread to unblock. | |
| let epoll = epfd.downcast::<Epoll>().unwrap(); | |
| if let Some(thread_id) = epoll.thread_id.borrow_mut().pop() { | |
| waiter.push(thread_id); | |
| }; |
Side note:
Blocking socketpair #3665 would need to use this too.
Metadata
Metadata
Assignees
Labels
A-concurrencyArea: affects our concurrency (multi-thread) supportArea: affects our concurrency (multi-thread) supportA-shimsArea: This affects the external function shimsArea: This affects the external function shimsC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement