-
Notifications
You must be signed in to change notification settings - Fork 34
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
Run native blocking code #154
Comments
It sounds to me like this would work if you were to use a |
I don't think you can block on a std::sync::mpsc in shuttle, it will stall everything. I ended up trying this: |
I'm trying out shuttle for https://github.com/anacrolix/possum. In some tests that are multithreaded, I need to call in to rusqlite code which then calls into C code which blocks the calling thread. After lots of trial and error I think I discovered that shuttle is not using native threads under the hood but its own kind of green threading. This doesn't play well with calling into code that hasn't been instrumented with shuttle primitives.
How can I call into that code? I was going to create a wrapper that spawned a native thread to run blocking code in rusqlite, then wait on the result from a shuttle mpsc channel but then I realised I can't send the result into a shuttle channel from a thread that wasn't created by shuttle.
The text was updated successfully, but these errors were encountered: