Strange. I created the four data files required and ran your code as is and it produced the following output (I've wrapped the numbers onto single lines to save screen space!):
c:\test>555304 Thread 1 Thread 2 Thread 3 Thread 4 Via system: 1 2 3 4 5 6 7 8 9 Via system: 1 2 3 4 5 6 7 8 9 Via system: 1 2 3 4 5 6 7 8 9 Via system: 1 2 3 4 5 6 7 8 9 Via backticks 1 2 3 4 5 6 7 8 9 Via backticks 1 2 3 4 5 6 Via backticks 1 2 3 4 5 6 7 8 9 7 8 9 Via backticks 1 2 3 4 5 6 7 8 9 Via pipe 1 2 3 4 5 6 7 8 9 Via pipe 1 2 3 4 5 6 7 8 9 Via pipe 1 2 3 4 5 6 7 8 9 Via pipe 1 2 3 4 5 6 7 8 9
As you can see, all four threads ran all 3 methods without problems. The "sorted" output is a little mixed up as you might expect with four threads all outputting to the screen concurrently, but no hangs or errors. I did this with AS811 and AS817 with the same results. I don't have AS813 installed, but I do not expect it to fail, but if it is, the answer is to upgrade.
If upgrading doesn't fix your problem, then we'll need to look more closely at your environment to try and understand what is broken on your system/installation.
In reply to Re^3: Behavior of threads on XP-- system() works, backtic & popen don't...
by BrowserUk
in thread Behavior of threads on XP-- system() works, backtic & popen don't...
by Sync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |