-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support custom mutexes via lock_api
on no_std
#207
Comments
My gut feeling is that it's better to publish this as a separate crate: types in once_cell are deliberately non-parametric, it just uses the "default" synchronization. Would be happy to advertise that from Readme! So, for example, if the leaf crate opts into critical section, than all upstream crates would also use critical_section, without any code changes. A once-cell parametrized over locking API would certainly be a useful thing! But it's fundamentally a different design. What would work for this crate is |
I understand. Thanks for your quick reply! :) I think, I'll go for a separate crate based on Would you prefer a name without reference to |
No opinion
let's keep it open |
209: Advertise generic_once_cell r=matklad a=mkroening I just published [generic_once_cell](https://crates.io/crates/generic_once_cell) (docs are still building). This PR advertises generic_once_cell from the docs and the readme. Closes #207. Co-authored-by: Martin Kröning <mkroening@posteo.net>
209: Advertise generic_once_cell r=matklad a=mkroening I just published [generic_once_cell](https://crates.io/crates/generic_once_cell) (docs are still building). This PR advertises generic_once_cell from the docs and the readme. Closes #207. Co-authored-by: Martin Kröning <mkroening@posteo.net>
I would like to use
once_cell
in libhermit-rs, a kernel with SMP support where neither spinning nor usingcritical-section
alone would be sufficient. (spinning alone does not work because of interrupts, critical sections are not ideal as they are global and not parallel)A design using
lock_api
would allow us to provide our own mutex implementation via a generic type parameter onOnceCell
andLazy
:With this, it would also be possible to use
spin-rs
if one would really want to (#61).Would you be open to such an approach, @matklad? I could start working on a PR.
The text was updated successfully, but these errors were encountered: