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

use non blocking futures instead of async methods #27

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

mockersf
Copy link
Contributor

@mockersf mockersf commented Jul 5, 2023

Fixes #24, alternative to #25

Instead of spawning tasks that are just thinly async function that always block, create futures that don't block

To reproduce the issue, you can set the number of thread in the IO task pool by doing

        .add_plugins(
            DefaultPlugins
                .set(TaskPoolPlugin {
                    task_pool_options: TaskPoolOptions {
                        io: TaskPoolThreadAssignmentPolicy {
                            min_threads: 1,
                            max_threads: 1,
                            percent: 1.0,
                        },
                        ..default()
                    },
                }),
        )

and settings logs for bevy_core to trace to confirm. Running example piano with those settings blocks and don't render anything on main, but works with this PR

@BlackPhlox
Copy link
Owner

Thanks, this is great!
I could reproduce the issue 🚀
Merging this in lieu of #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Io Task Pool starvation
2 participants