On 8/28/14 5:56 PM, Cameron Zwarich wrote:
It’s nice that it’s so close to the competition. It would be interesting to see
numbers on ARM as well, since the relative cost of the atomic instructions
might be higher, even in the uncontended case.
Is it strictly enforced that the script task never sees inconsistent views of
layout? This came up in the other thread about threading, but what prevents
this incorrect scenario?
1) The script task takes the mutex to access one property of layout.
2) The script task releases the mutex.
3) Layout changes the property that was accessed.
4) The script task takes the mutex again to access the same property, in the
same turn of the event loop without modifying layout in any intervening work
since the last attempt.
5) The script task reads a different value from before.
Doh. I wonder if we should just keep the mutex held until the next turn
of the event loop (though don't take it at the outset until the moment
script starts reading back from layout).
This is actually even better for Clark's benchmark, as it reduces the
number of atomic operations in the tight loop to O(1) from O(n).
Patrick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo