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

Backport of all the multi-threading modernization (3.2) #45618

Merged
merged 5 commits into from Feb 18, 2021

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Jan 31, 2021

This a backport of all the multi-threading modernization and enhancements that exist currently for Godot 4.0.

It contains what was already in 4.0 before I started this modernization effort (like Semaphore), plus everything else I've done for that version: Thread, Mutex, atomics, etc.

Benefits:

  • Better portability (former implementations behaved differently across platforms in terms of memory barriers). This is important for 3.2 as it contributes to future-proofing it by clearing the potential maintenance burden of OS-specific implementations of those classes as well as stop relying on the non-standard behavior of volatile that compilers are allowed to stop implementing.
  • Better responsiveness when a thread is waiting for another to finish (to close the editor, etc.).
  • Maybe some hard to reproduce bugs are fixed as a side effect.

UPDATE: I've tested it myself with the TPS demo (going through all the workflow at the editor -importing everything, etc.) and a few other demo projects on Windows and Android.


This code is generously donated by IMVU.

- Based on C++14's `shared_time_mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
akien-mga added a commit to akien-mga/godot that referenced this pull request Mar 11, 2021
akien-mga added a commit that referenced this pull request Apr 6, 2021
[3.x] Android: Fix access to JavaVM for threads after #45618
@akien-mga akien-mga modified the milestones: 3.2, 3.3 Apr 20, 2021
lekoder pushed a commit to KoderaSoftwareUnlimited/godot that referenced this pull request Apr 24, 2021
akien-mga added a commit to akien-mga/godot that referenced this pull request Apr 27, 2021
The min requirement was upped by godotengine#45618 to have proper support for C++14.

Related to godotengine#48222.
akien-mga added a commit that referenced this pull request Apr 27, 2021
The min requirement was upped by #45618 to have proper support for C++14.

Related to #48222.

(cherry picked from commit 8851fa7)
@RandomShaper RandomShaper deleted the modernize_mt_3.2 branch June 13, 2021 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants