-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup the multithreaded executor (#12969)
# Objective Improve the code quality of the multithreaded executor. ## Solution * Remove some unused variables. * Use `Mutex::get_mut` where applicable instead of locking. * Use a `startup_systems` FixedBitset to pre-compute the starting systems instead of building it bit-by-bit on startup. * Instead of using `FixedBitset::clear` and `FixedBitset::union_with`, use `FixedBitset::clone_from` instead, which does only a single copy and will not allocate if the target bitset has a large enough allocation. * Replace the `Mutex` around `Conditions` with `SyncUnsafeCell`, and add a `Context::try_lock` that forces it to be synchronized fetched alongside the executor lock. This might produce minimal performance gains, but the focus here is on the code quality improvements.
- Loading branch information
Showing
2 changed files
with
42 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters