Re:Guido van Rossum Deconstructing Twisted's Deferreds
by rdtsc on Tuesday August 20, 2013 @10:07AM
(#6243765)
Yap. But it breaks isolation. Some places need that. There is no free lunch again. Otherwise semantically it is accessing the same data from multiple concurrency contexts. Once that concurrency grows it becomes very hard to reason about who and when changed what if you get a crash. Setting write watch-points in gdb is one way I found to do it in C++ for example.
[ Parent
| on HN ]
Re:Guido van Rossum Deconstructing Twisted's Deferreds
by cmccabe on Tuesday August 20, 2013 @09:59PM
(#6247728)
You can always pass around pointers to immutable data structures which only implement read interfaces.
Re:Guido van Rossum Deconstructing Twisted's Deferreds
by rdtsc on Wednesday August 21, 2013 @12:50AM
(#6248252)
Exactly. Or maybe copy-on-duplicate-access detection. So keep a single copy on heap but when accessed first time by second context/thread then make a copy of it. Azul's Java GC plays some of these games with read barriers. They detect reads to certain pointers and set callbacks to run custom code when they happen.