Replace Mutex with cordyceps::TransferStack for Epochs and make no_std compatible#145
Replace Mutex with cordyceps::TransferStack for Epochs and make no_std compatible#145ilslv wants to merge 2 commits intojonhoo:mainfrom
Mutex with cordyceps::TransferStack for Epochs and make no_std compatible#145Conversation
… no_std compatible
|
|
||
| [dependencies] | ||
| slab = "0.4.1" | ||
| cordyceps = { version = "0.3" } |
There was a problem hiding this comment.
cordyceps has a following note
This is a hobby project. I’m working on it in my spare time, for my own personal use. I’m very happy to share it with the broader Rust community, and contributions and bug reports are always welcome. However, please remember that I’m working on this library for fun, and if it stops being fun…well, you get the idea.
Anyway, feel free to use and enjoy this crate, and to contribute back as much as you want to!
But implementation looks very solid and embassy-executor uses it
| /// [`ReadHandle`]s don't clean up anything on [`drop`], so there is opportunity for an unbounded | ||
| /// memory growth in case [`WriteHandle`] does nothing and new [`ReadHandle`]s are created and | ||
| /// dropped. |
There was a problem hiding this comment.
I would say this is my main concern with the implementation. Would this be a dealbreaker?
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
| strategy: | ||
| matrix: | ||
| msrv: ["1.60.0"] | ||
| msrv: ["1.66.0"] |
There was a problem hiding this comment.
cordyceps declares MSRV at 1.61.0, but actually it's 1.66.0. I'll report it to upstream a little later
Hi! I've recently saw a talk and was wondering what will it take to remove
Mutexlock onReadHandleinitialisation and drop.The simplest approach I could come boils down to the following idea: what if
ReadHandles wouldn't bother themselves with removal of theirEpochs from sharedEpochsand would just drop theArc. ThenWriteHandlecan check forReadHandleliveliness withArc::strong_countsince everyArchas a strong count of 1 or 2. After that it became obvious that something likecordyceps::TransferStackcan be used to semantically replaceEpochsfrom "shared storage ofEpochs that is accessed both byReadHandles andWriteHandle" to "a kinda channel to letWriteHandleknow about newReadHandles".I also made library
no_stdcompatible as mentioned in #101.I think more tests should be added before merging, but before investing more time I would love to here about approach in general and haven't I missed something.