So the first thing that might help here is using t...
# coroutines
g
So the first thing that might help here is using the
Unconfined
dispatcher in your
map
function, I think this will get your outer deferred running on the inner deferred's thread, which might make this a bit more straight forward to debug
n
So yes, If i use the Unconfined dispatcher it works. I also changed the dispatcher to be a threadpool with 1 thread. that also works. I believe the cpu cache theory is the thing here. Since the map isn’t a true function (returning the same instance), i believe if somehow the other thread got hold of that instance the lookups are not done to heap, instead from the cpu cache, in which case it will see the stale value, as the field isn’t volatile. @groostav