-
Notifications
You must be signed in to change notification settings - Fork 927
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
embassy-sync: Add RwLock #1394
Comments
I think I can give this a shot, I already got a prototype working. Is there anyway I can write tests for asynchronous primitives running on embassy's executor? Or I just create a normal test which runs the rwlock using tokio? |
There's already some tests using Using another executor is fine, embassy-sync is executor-independent and using embassy-executor would be annoying for tests because tasks are statically allocated. |
Didn't saw that, thanks! |
Awesome idea for a feature. I've wondered why there hasn't been anything like that so far. |
How hard to implement would this be for a beginner? |
@Ragarnoy This is my current implementation so far: https://github.com/McMaster-Rocketry-Team/rust-monorepo/blob/master/vlfs/src/utils/rwlock.rs It works, however it is not fair, meaning too many readers can starve writers. |
Fixes embassy-rs#1394 --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/embassy-rs/embassy/issues/1394?shareId=XXXX-XXXX-XXXX-XXXX).
Something like async-std's RwLock would be extremely helpful for implementing async programs.
The text was updated successfully, but these errors were encountered: