forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 2
Porting Godot 4: Threading
Caroline Joy Bell edited this page Apr 15, 2024
·
1 revision
Godot 4 uses multi-threading to run its various servers. As such, low level features, such as threads, semaphores, and mutexes, must be reachable by Godot. Godot, by default, uses the standard C library thread implementation. This means that for a lot of platforms, if programming guidelines are not a concern, multi-threading will "just work" with no extra input from a porter. But, what if your platform has guidelines on how to implement threading, such as on a closed platform?
In Godot 4, there's a struct in the Thread
class called PlatformFunctions
. It contains settable pointers to functions for setting thread priority, initializing a thread, wrapping a thread, and terminating a thread.
-
Thread
PlatformFunction
callbacks:init
priority
wrap
term
- 2.x
- 3.x
- Nintendo Wii
- 3.5 for Nintendo Switch
- 3.5 for Playstation Vita
- 4.x
- *New* Nintendo 3DS
- 4.2 for Nintendo Wii U
- Nintendo Switch