The problem here is with the #1
delay, each iteration of the for
loop executes with a different value of the iterator variable i
. When the delay is removed, all iterations are sharing the same loop iterator variable whose value is two by the time the print statement gets executed. See For loop inside fork join_none - #13 by dave_59