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
No parallelization when accessing NonSend/NonSync storage in workload #101
Comments
I used The restrictions go like this:
|
To be clear this applies to struct NonSendSyncComponent;
struct OtherComponent;
let world = World::new();
world
.add_workload("workload")
.with_system(system!(|_: NonSendSync<View<'_, NonSendSyncComponent>>| {
println!("system 1");
sleep(Duration::from_secs(1));
}))
.with_system(system!(|_: View<'_, OtherComponent>| {
println!("system 2");
sleep(Duration::from_secs(1));
}))
.build();
world.run_workload("workload");
// output:
// system 1
// [1s passes]
// system 2 Anyway |
Oh I understand now. |
I was thinking kick off the other systems asynchronously through rayon, run the |
rayon probably doesn't have an api for it. We could spawn a thread when creating |
Huh, too bad, I just assumed that part would be straightforward 😕 I can look into it some more later then, thanks for the feedback! |
Turns out |
Currently a system with a
NonSend
and/orNonSync
input always runs alone, but it should be possible to run other non-conflicting systems in parallel while running that system on the main thread.I'm happy to post a PR, seems like it should be relatively straightforward, just checking first since it involves some core code that I'm not too familiar with. Does this conflict with anything you're working on/have planned, or is there some reason it's not feasible?
The text was updated successfully, but these errors were encountered: