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

Thread-Safety for NoiseGenerator and Tile/Gridmaps #127

Merged
merged 4 commits into from
Jun 21, 2024

Conversation

cullumi
Copy link
Contributor

@cullumi cullumi commented Jun 19, 2024

Just a few adjustments in response to #126.

This PR does two things:

  • Makes NoiseGenerator's generate_chunk method thread-safe (using deferred signal emissions).
  • Aims to fix a source of lag caused by batching many deferred Tile/GridMap set_cell and erase_cell calls inside of Tile/GridmapGaeaRender's _draw_area method.

As for the lag issue, the proposed solution is to replace these deferred calls with call_thread_safe. This fixes the issue by ensuring that when threaded, _draw_area won't try to queue up significant numbers of deferred but expensive calls. Instead it will wait for the completion of one, then go to the next, and so on (all without blocking the main thread).

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.

2 participants