-
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
AlmostOnceCell #133
Comments
your wish is granted https://docs.rs/once_cell/1.5.2/once_cell/race/index.html |
😀 |
BTW, could you do an API review for the race module? It currently is behind
unstable flag; if API looks good to you, I’ll stabilize it
…On Tuesday, 12 January 2021, Tom Kaitchuck ***@***.***> wrote:
Closed #133 <#133>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#133 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3MYTIWZZ32QALMYUBILSZPATFANCNFSM4V56QVHQ>
.
|
Well it does look inconsistent with the others. I don't know if there is a reason for that.
|
As an alternative to #61 or #53
in the case of a no_std environment where lazy initialization is needed, it would be useful to have an implementation which did not block (and hence depend on locking) or spin, but simply re-ran the initialization logic.
So if the initialization has been completed the existing result is used. However if init is attempted from multiple threads concurrently, then it just gets run more than once. For cases where the init is deterministic this provides a clean, zero-dependency, solution.
The text was updated successfully, but these errors were encountered: