Open PegasisForever opened 1 year ago
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 futures-test
: https://github.com/embassy-rs/embassy/blob/master/embassy-sync/src/channel.rs#L472
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.
Something like async-std's RwLock would be extremely helpful for implementing async programs.