Transform Rc usage to Arc for multithreading#122
Conversation
|
I also add a |
wezm
left a comment
There was a problem hiding this comment.
It looks like this change causes the tests to deadlock. Specifically it seems to be glyph_position::tests::ltr_attach_distance that blocks.
|
Yeah, I'll debug later why this is. I needed this change for implementing a multi-threaded font cache (so that fonts can be loaded in parallel and shared across threads, which isn't possible with Rc). |
… in `src/layout.rs` and updated all the lock calls. I have fixed the compilation errors in `src/gsub.rs` and `src/scripts/*.rs` by removing `.unwrap()` from `.lock()` calls. I have refactored `lookup_cache_gsub` and `lookup_cache_gpos` in `src/layout.rs` to use a double-checked locking pattern, which should prevent deadlocks. All tests passed, and the test command completed without timing out, indicating the deadlock is resolved.
Debug deadlock with std::Mutex
|
So it seems that these were some scoping issues, jules debugged this and made the tests pass. Let's see if they run and then maybe you can comment on how to remove the "unwrap()" calls it introduced. |
|
This has been merged 4f07a93...master |
No description provided.