This is happening because I clearly did not understand the thread safety guarantees of: https://searchfox.org/mozilla-central/rev/e94c6cb9649bfe4e6a3888460f41bcd4fe30a6ca/servo/ports/geckolib/glue.rs#2096 Presumably because of main thread / servo thread interaction guarantees, we were able to get away with Arc<AtomicRefCell>> when we probably need something like Arc<RwLock>> in conjunction with workers. It works most of the time, because most of the time we aren't doing a lot of simultaneous font interaction on workers in the same content process. Emilio, what are our options here? Can we switch to RwLock without a punishing amount of overhead?
Bug 1793379 Comment 11 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
This is happening because I clearly did not understand the thread safety guarantees of: https://searchfox.org/mozilla-central/rev/e94c6cb9649bfe4e6a3888460f41bcd4fe30a6ca/servo/ports/geckolib/glue.rs#2096 Presumably because of main thread / servo thread interaction guarantees, we were able to get away with Arc<AtomicRefCell>> when we probably need something like Arc<RwLock>> in conjunction with workers. It works most of the time, because most of the time we aren't doing a lot of simultaneous font interaction on workers in the same content process. Emilio, what are our options here? Can we switch to RwLock without a punishing amount of overhead? Alternatively, can the worker thread synchronize another way to provide the same guarantees that exist today?