Skip to content
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

[Question] Integration with loom or shuttle? #23

Closed
rmcgibbo opened this issue Oct 13, 2021 · 3 comments · Fixed by #126
Closed

[Question] Integration with loom or shuttle? #23

rmcgibbo opened this issue Oct 13, 2021 · 3 comments · Fixed by #126

Comments

@rmcgibbo
Copy link

Hi,

This package has been a lifesaver. I really unable to implement https://github.com/rmcgibbo/async-priority-channel (which whos API is basically copied completely from smol-rs/async-channel) without out.

One question: would it be straightforward/possible for event-listener to provide a hook to use loom or shuttle. I'd like to be able to test my code which depends on event-listener using these techniques if possible. tokio-rs/loom#220 seems to indicate that the latest release of loom now handles SeqCst which is probably necessary.

@taiki-e
Copy link
Collaborator

taiki-e commented Oct 13, 2021

I would accept a PR to support loom in a similar way as crossbeam-rs/crossbeam#487.

@rmcgibbo
Copy link
Author

I looked into this a bit tonight. It seems like event-listener relies heavily on std::thread::park() and std::thread::unpark which are not implemented yet on loom::thread. This PR added loom::thread without park: tokio-rs/loom#175. This question seems to indicate that yield_now might be a substitute for park, but I don't think that'll work for event-listener at all. tokio-rs/loom#133

Without park, it seems like the loom version and the normal version of event-listener would have to be very different (replace park/unpark with an extra loom::sync::mutex and loom::sync::condvar?), which is not desirable.

@taiki-e
Copy link
Collaborator

taiki-e commented Jul 17, 2022

It seems tokio-rs/loom#133 has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants