2 ms·
> O(N log(N)) where N is the maximum number of live threads that have read the variable and M is the number of values that have been set and possibly released).
by nyanpasu64 4y ago
> O(N log(N)) where N is the maximum number of live threads that have read the variable and M is the number of values that have been set and possibly released).
If you reference N twice and M zero times, why did you define M? Did you make a typo in the O() or is this intentional?
> Most threads only ever need to call thread_safe_var_get().
> reference count the data.
Does getting a new value automatically release a reference to the old one (so it's no longer safe to read)?
- cryptonector 4y ago> If you reference N twice and M zero times, why did you define M? Did you make a typo in the O() or is this intentional? That was a typo. It should have read `O(N log(M))`. > Does getting a new value automatically release a reference to the old one (so it's no longer safe to read)? Correct. Every read (get) of the variable causes the previous value to no longer be safe to use in that thread.