Paul Dicker

Results 294 comments of Paul Dicker

I don't think `&LCell` → `&[LCell]` is sound. `LCellOwner::rw2` would then allow you to take a mutable reference of both the entire slice `LCell` and the slice element `LCell`. Btw....

Sorry, I remember typing a second reply two days ago. I was too soon to call it unsound. If `LCellOwner::rw2` not only checks the pointers are not equal, but also...

Great RFC, I hope it makes it into the standard library! One other aspect that the crate [`conquer_once`](https://docs.rs/conquer-once/0.1.2/conquer_once/raw/struct.OnceCell.html) tackles is a distinction between blocking and non-blocking methods. I believe this...

A small difference that may be worth noting: `std::sync::Once` will only run its closure once, while `OnceCell::get_or{_try}_init` will one run its closure once *successfully*.

We _always_ have to do a `Release` on `CELL` after running the closure, without exception. So we can guarantee that `FLAG` is set before that. But I don't think we...

Thank you! I'll think about it a bit first, I am unreliable... :smile:

Just to write it down for now: this a way to detect reentrancy without increasing the size of `OnceCell` using the std method. Currently it uses a linked list of...

The `break_it` test that I added in https://github.com/matklad/once_cell/pull/71 turns out to be a good stress test to time the performance of parking/unparking under contention. Rough results: | | x86_64 |...

> Thinking of it, looks like even set can't be lock, in general? You need to atomically set both the is_completed state and the value, and you can only do...

Changing the current `set` to not block would be a difficult change, as code currently could call `get_unchecked` after a `set` and expect it to be safe. A non blocking...