Your mytest routine will run concurrently, but you have a race condition. You should pass the value of $j into the thread at thread creation time instead of accessing a global variable. As your threads run, there is a chance that two threads will try to use the same value in $j to move a file.Aren't Perl variables supposed to be non-shared by default?
In reply to Re^2: Did I create a concurrent program?
by JavaFan
in thread Did I create a concurrent program?
by jweden1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |