bevy/crates/bevy_ecs/src
James Liu d33f5c759c
Add optional single-threaded feature to bevy_ecs/bevy_tasks (#6690)
# Objective
Fixes #6689.

## Solution
Add `single-threaded` as an optional non-default feature to `bevy_ecs`
and `bevy_tasks` that:
 
 - disable the `ParallelExecutor` as a default runner
 - disables the multi-threaded `TaskPool`
- internally replace `QueryParIter::for_each` calls with
`Query::for_each`.

Removed the `Mutex` and `Arc` usage in the single-threaded task pool.


![image](https://user-images.githubusercontent.com/3137680/202833253-dd2d520f-75e6-4c7b-be2d-5ce1523cbd38.png)

## Future Work/TODO
Create type aliases for `Mutex`, `Arc` that change to single-threaaded
equivalents where possible.

---

## Changelog
Added: Optional default feature `multi-theaded` to that enables
multithreaded parallelism in the engine. Disabling it disables all
multithreading in exchange for higher single threaded performance. Does
nothing on WASM targets.

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2023-07-09 04:22:15 +00:00
..
entity Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
query Add optional single-threaded feature to bevy_ecs/bevy_tasks (#6690) 2023-07-09 04:22:15 +00:00
reflect bevy_reflect: FromReflect Ergonomics Implementation (#6056) 2023-06-29 01:31:34 +00:00
schedule Add optional single-threaded feature to bevy_ecs/bevy_tasks (#6690) 2023-07-09 04:22:15 +00:00
storage Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
system Add/fix track_caller attribute on panicking entity accessor methods (#8951) 2023-06-26 18:35:11 +00:00
world Provide access to world storages via UnsafeWorldCell (#8987) 2023-06-29 01:29:34 +00:00
archetype.rs Fix typo in Archetypes documentation (#8990) 2023-06-28 19:33:18 +00:00
bundle.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
change_detection.rs Allow unsized types as mapped value in Ref::map (#8817) 2023-06-12 17:52:11 +00:00
component.rs Derive Eq, PartialEq for Tick (#9020) 2023-07-04 19:08:51 +00:00
event.rs Document every public item in bevy_ecs (#8731) 2023-06-10 23:23:48 +00:00
lib.rs Implement WorldQuery for EntityRef (#6960) 2023-06-22 21:20:00 +00:00
removal_detection.rs Simplify the ComponentIdFor type (#8845) 2023-06-15 12:57:47 +00:00