Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Use a bounded channel in the multithreaded executor #7829

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use a bounded channel in the multithreaded executor
  • Loading branch information
james7132 committed Feb 27, 2023
commit 8675f832c2d7fe2a35b08a4d3601c31792b2279a
4 changes: 4 additions & 0 deletions crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ impl SystemExecutor for MultiThreadedExecutor {
let sys_count = schedule.system_ids.len();
let set_count = schedule.set_ids.len();

let (tx, rx) = async_channel::bounded(sys_count);

self.sender = tx;
self.receiver = rx;
self.evaluated_sets = FixedBitSet::with_capacity(set_count);
self.ready_systems = FixedBitSet::with_capacity(sys_count);
self.ready_systems_copy = FixedBitSet::with_capacity(sys_count);
Expand Down