Re:What Happens to OO When Processors Are Free? (2015)
by comex on Sunday January 15, 2017 @04:46PM
(#13406562)
That's sort of like software transactional memory, which has a reputation for being slow. However, limiting transactions to one object at a time may avoid most of the overhead; in fact I suspect it would often perform better than locking. On the other hand, that sounds tough to reason about… do you just always use persistent (immutable) data structures? Because those have quite a bit of overhead (if you don't need persistence anyway for some reason). If not, how do you prevent one thread from seeing another thread's transaction in progress?
[ Parent
| on HN ]
Re:What Happens to OO When Processors Are Free? (2015)
by jinjin2 on Sunday January 15, 2017 @08:13PM
(#13407603)
> how do you prevent one thread from seeing another thread's transaction in progress?
In Realm this is done by each thread having its own immutable snapshot of the data which is only advanced to the latest state at very specific "safe" points in the code. The result of this is that data never changes underneath you (i.e. You never see changes from transactions in progress. You only see after they have been atomically applied).