A LuaJIT threading system based on C pthreads.
Note: after writing this, I discovered that threads-ffi also exists.
require '../pthreads'
print(
multithread{
print=true,
time=true,
nthreads=10,
globals={
sum = 0,
},
fname='hello',
f=[[function(id) sum = sum + id end]],
}.sum
)