-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Description
What problem does this solve or what need does it fill?
The existing parallel iteration strategy requires specifying a thread pool, generally through Res<ComputeTaskPool>, and then passing in the parameters via a closure. See https://github.com/bevyengine/bevy/blob/main/examples/ecs/parallel_query.rs
What solution would you like?
- Implicitly fetch the
ComputeTaskPoolresource with each query. This is cloned during system initialization. - Rename the existing method to
par_for_each_manualand so on. - Add an ergonomic method for
par_for_each(and eventuallypar_iterand friends) which uses this task pool.
What alternative(s) have you considered?
We could instead create a global / static thread pool that is always used. This may be necessary for performance or ergonomics reasons, but should not be necessary.
Additional context
We cannot deprecate the existing techniques, as other thread pools may be desired in niche situations.
Related to #2088.
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!