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. Also, there is little sense in using threads for IO operations, as IO operations that use the full bandwidth of the bus available seldom benefit from parallelization.
In reply to Re: Did I create a concurrent program?
by Corion
in thread Did I create a concurrent program?
by jweden1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |