Working on getting pseudoThreading tests to work

This commit is contained in:
2023-10-15 13:21:57 -04:00
parent ad929da484
commit ef7464f70d
14 changed files with 1150 additions and 28 deletions
+3 -1
View File
@@ -172,6 +172,7 @@ function multi:newSystemThreadedJobQueue(n)
multi:newSystemThread("JobQueue_"..jqc.."_worker_"..i,function(jqc)
local multi, thread = require("multi"):init()
require("love.timer")
love.timer.sleep(1)
local clock = os.clock
local funcs = THREAD.createTable("__JobQueue_"..jqc.."_table")
local queue = THREAD.waitFor("__JobQueue_"..jqc.."_queue")
@@ -208,11 +209,12 @@ function multi:newSystemThreadedJobQueue(n)
local id = table.remove(dat,1)
local tab = {funcs[name](multi.unpack(dat))}
table.insert(tab,1,id)
--local test = queueReturn.push
queueReturn:push(tab)
end)
end
end
end).OnError(multi.error)
end)
thread:newThread("Idler",function()
while true do
thread.yield()
+2
View File
@@ -60,6 +60,8 @@ function multi:newSystemThread(name, func, ...)
table.insert(threads, c)
c.OnError(multi.error)
if self.isActor then
self:create(c)
else