SquidDev-CC / CCTweaks

Random additions to ComputerCraft (somewhat deprecated, use CC-Tweaked if you're on Minecraft 1.12).
MIT License
12 stars 2 forks source link

Cobalt multithreading does not appear to work #121

Closed inklit closed 7 years ago

inklit commented 7 years ago

I set the thread count to 8, and then put 12 PCs directly next to eachother and ran your script that was posted on the CC forums:

print("Preparing to run a long task")
print("We're not going to yield much")

while true do
  for i = 1, 5 do
    for _ = 1, 2e6 do bit.band(1, 1) end
    print("Iteration " .. i)
  end
  write("Yielding... ")
  os.queueEvent("a")
  os.pullEvent("a")
  print("Done!")
end

All 12 PCs freeze when it isnt yielding, and so does every other computer on the server.

Do note that this is a public server with over 100 concurrent computers so I reckon my test size might not be enough but it still doesn't look very good for the case.