Difference between revisions of "Core.asyncThread"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Core.asyncThread(task,parameters) | Core.asyncThread(task,parameters) | ||
− | </ | + | </syntaxhighlight> |
− | Parallel threads are executed in parallel with main thread.Care should be taken to avoid messing with main thread or other threads data. See [[table.share]] for making lua tables thread safe, and check various API thread safety. | + | Parallel threads are executed in parallel with main thread. Care should be taken to avoid messing with main thread or other threads data. See [[table.share]] for making lua tables thread safe, and check various API thread safety. |
=== Parameters === | === Parameters === | ||
'''task''': (function) function to run in parallel<br/> | '''task''': (function) function to run in parallel<br/> | ||
'''parameters''': (multiple) multiple parameters to pass to function '''optional'''<br/> | '''parameters''': (multiple) multiple parameters to pass to function '''optional'''<br/> | ||
− | |||
{{Core}} | {{Core}} |
Latest revision as of 02:11, 3 February 2024
Available since: Gideros 2022.9
Class: Core
Description
Launches a function on a separate thread as a parallel task.
Core.asyncThread(task,parameters)
Parallel threads are executed in parallel with main thread. Care should be taken to avoid messing with main thread or other threads data. See table.share for making lua tables thread safe, and check various API thread safety.
Parameters
task: (function) function to run in parallel
parameters: (multiple) multiple parameters to pass to function optional