# Threaded inner loop, each thread has no dependence upon others
Threads.@threads for t=1:Nthr
inner_gen_cpu1!(psum,ms,me,cls,2)
end
That's all you need. You don't need pthread create/join, you don't need installable language extensions, you don't need to appeal to external tools/libraries to enable threading. Its built in to Julia. And it is trivial to use.