Skip to content

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.

@RandomShaper RandomShaper added this to the 3.2 milestone Jan 31, 2021
@RandomShaper RandomShaper force-pushed the modernize_mt_3.2 branch 8 times, most recently from 2840b5a to 869b4b3 Compare February 1, 2021 17:31
@RandomShaper RandomShaper marked this pull request as ready for review February 1, 2021 20:20
@RandomShaper RandomShaper force-pushed the modernize_mt_3.2 branch 3 times, most recently from e499769 to 55f34a1 Compare February 4, 2021 11:54
- 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