Executes the given function in a separate thread, threads are pooled and reused.
It runs faster than task.spawn
if the thread doesn't yield (The more non-yielding threads you can make go
, the more threads you can reuse.)
- Very small and simple module, useful for optimizing
task.spawn
by reusing threads. - Original: util.luau/threadpool
- Supports executing functions in separate threads and reusing threads
- Supports various lua environments (luau, lune, and roblox)
pesde add jiwonz/go
local t: thread = go(function()
...
end)