Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
codedokode
7mo ago
0 comments
Share
How do you implement "commit" part safely (writing changes to the object) without locking the object?
0 comments
default
newest
oldest
titzer
7mo ago
One way is that the writer thread prepares a completely new copy of the object in a private area and then either compare-and-swaps a pointer to it, or executes a store with a store-store barrier (depending on details of the STM system around it).
codedokode
OP
7mo ago
Interesting, it's almost like immutable data structures.
j
/
k
navigate · click thread line to collapse