In this program the system function calls an executable that takes at least 20 sec per argv but i found that the cout in line with comments Mark1 and Mark2 get print at the same time at the end of the loop... cant figure out why... i even introduced a volatile variable thinking it would fix it... any idea why the program is behaving this way..