Jelajahi Sumber

Reword warning about slow thread creation in Using multiple threads

Hugo Locurcio 6 bulan lalu
induk
melakukan
ff84bad138
1 mengubah file dengan 11 tambahan dan 3 penghapusan
  1. 11 3
      tutorials/performance/using_multiple_threads.rst

+ 11 - 3
tutorials/performance/using_multiple_threads.rst

@@ -141,9 +141,17 @@ wait until the thread is done (if not done yet), then properly dispose of it.
 
 .. warning::
 
-    Creating threads at runtime is slow on Windows and should be avoided to
-    prevent stuttering. Semaphores, explained later on this page, should be used
-    instead.
+    Creating threads is a slow operation, especially on Windows. To avoid
+    unnecessary performance overhead, make sure to create threads before heavy
+    processing is needed instead of creating threads just-in-time.
+
+    For example, if you need multiple threads during gameplay, you can create
+    threads while the level is loading and only actually start processing with
+    them later on.
+
+    Additionally, locking and unlocking of mutexes can also be an expensive
+    operation. Locking should be done carefully; avoid locking too often (or for
+    too long).
 
 Mutexes
 -------