Difference between revisions of "X Threads"
Line 3: | Line 3: | ||
<!-- GIDEROSOBJ:Threads --> | <!-- GIDEROSOBJ:Threads --> | ||
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform pc.png]][[File:Platform mac.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform pc.png]][[File:Platform mac.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/> | ||
− | '''<translate>Available since</translate>:''' 2018. | + | '''<translate>Available since</translate>:''' 2018.10<br/> |
=== <translate>Description</translate> === | === <translate>Description</translate> === | ||
<translate>The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available. | <translate>The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available. |
Revision as of 13:24, 4 October 2018
Supported platforms:
Available since: 2018.10
Description
The Threads plugin provides the ability to run Lua code in separate threads, taking advantage of multiple cores where available.
Example
Simple example of getting result from thread.
require "Threads"
local thread = Thread.new()
thread:setFunction(function()
local a
for i = 1, 10000000 do
a += 1
end
return i
end)
thread:execute()
local ok = false
while not ok do
ok = thread:getResult()
end
print("woot!")
MethodsThread.new Creates a new thread object. |
Eventsnone Constantsnone |