Behavior of threads

Also relevant: Behavior of `Threads.@threads for` loop
With solution by @carstenbauer