in reply to threads on Windows

Ok here's something
Is your CPU multi-processor???
If your answer is yes, try this
C:\Windows\System32\cmd.exe /C start /AFFINITY 0x1 perl.exe <SCRIPT.pl +>
If this works, let us know.
Also, you can try printing something everytime a thread is executed (maybe the tid)
Update:
You can also try to control the number of threads (while queue
also helps as in your code), Even semaphores will help.
Raghu

Replies are listed 'Best First'.
Re^2: threads on Windows
by kennethk (Abbot) on Feb 12, 2009 at 15:31 UTC
    I'm running off a dual-core, but cannot execute the command you've suggested - I get an invalid switch /AFFINITY error. Printing a loop index confirms hang on new thread creation. Thankfully oshalla found where my threads were blocking. I appreciate your help.