Heading capitalization fixes + misc edits

This commit is contained in:
Rémi Verschelde
2018-08-23 10:57:22 +02:00
parent 8cd23c4d48
commit e29dc58cbb
33 changed files with 179 additions and 210 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Multi-Threading
Multi-threading
===============
.. toctree::
+5 -5
View File
@@ -1,6 +1,6 @@
.. _doc_thread_safe_apis:
Thread Safe APIs
Thread safe APIs
================
Threads
@@ -11,14 +11,14 @@ Godot supports multi threading, but not in the whole engine.
Below is a list of the areas in Godot and how they can be used with threads.
Global Scope
Global scope
------------
:ref:`Global Scope<class_@GlobalScope>` singletons are all thread safe. Accessing servers from threads is supported (for VisualServer and Physics servers, ensure threaded or thread safe operation is enabled in the project settings!).
This makes them ideal for code that creates dozens of thousands of instances in servers and controls them from threads. Of course, it requires a bit more code, as this is used directly and not within the scene tree.
Scene Tree
Scene tree
----------
Interacting with the active scene tree is **NOT** thread safe. Make sure to use mutexes when sending data between threads. If you want to call functions from a thread, the *call_deferred* function may be used:
@@ -39,8 +39,8 @@ However, creating scene chunks (nodes in tree arrangement) outside the active tr
enemy.add_child(weapon) # Set a weapon.
world.call_deferred("add_child", enemy)
GDScript Arrays, Dictionaries:
------------------------------
GDScript arrays, dictionaries
-----------------------------
In GDScript, reading and writing elements from multiple threads is ok, but anything that changes the container size (resizing, adding or removing elements) requires locking a mutex.