Difference between revisions of "Thread"
(merged the threads plugin with the thread class) |
|||
Line 59: | Line 59: | ||
|} | |} | ||
+ | |||
+ | {{GIDEROS IMPORTANT LINKS}} |
Revision as of 16:29, 30 January 2020
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 = 0
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. |
EventsConstants |