|
|
|
|
|
by cryptonector
372 days ago
|
|
The get function always returns you a stable value if at least one value was ever written (else you get NULL, natch). The set function will not invalidate any values seen by get that might still be referenced, but the new value will be seen by all subsequent gets. Old values will be destructed when no longer referenced. To read-copy-update you'll need to take a lock (that readers don't), get the current value (it will be the current one given you're locking out other writers), copy it, modify the copy, then set the new value. You don't have to read-copy-update if the new values don't depend on the preceding values. So my API does not force read-copy-update, but you can do RCU with it. |
|