add eval and potentially speed up variable access speeds when multi threading. fix bug in threading count

This commit is contained in:
2024-05-30 12:46:25 +01:00
parent 051581c84b
commit d48b0ab7b6
6 changed files with 69 additions and 18 deletions

14
tests/multi_threading.ar Normal file
View File

@@ -0,0 +1,14 @@
let mythread(threadID) = do
term.log(threadID, "start")
let mynumber = 10
for (i from 0 to 1e4) do
mynumber += 1
mynumber
return term.log(threadID, "done")
let threads = []
term.time("start")
for (i from 0 to 100) do
threads.append(thread(()=mythread(i)))
threads[i].start()
term.timeEnd("start")