On 8/29/14 5:27 AM, Lars Bergstrom wrote:
In general, I'd be a little wary of adding global locks into Servo
unless it's really necessary (i.e., if it turns out we can't
architect away the race condition Cameron brought up in any other
way). Since we haven't found a good way to do any concurrent protocol
verification yet for Servo, it's really easy to end up writing
deadlocky or racy code (mainly w.r.t. underlying native resource
allocation/destruction). For example, I spent way too much time
getting shutdown "cleaned up" so that we don't intermittently crash
due to attempting to render to graphics contexts that had been
destroyed too early, and that was just tracking through our spaghetti
message passing code, with no locks to reason about.

I agree in general. `MutexArc` should be your last resort.

I think that this one is worth making an exception for, though: it's pretty fundamental to the design, and we can potentially abstract it away via the "RPC" mechanism. I definitely agree that we shouldn't end up with a system where you have to sprinkle "lock_dom()" calls throughout script and layout: the locking should happen in a single well-defined place.

Patrick

_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to