my $k=1; for (230000..900000){ $k*=$_ } print $k; # typical alg. for factorial calculation #### thread1 : for (230000..565000){ #multiply } thread2: for (565001..900000){ #multiply } #### thread1 : for (230000..397500,732500..900000){ #multiply } thread2: for (397500..732500){ #multiply } # it will run faster