in reply to Re: Redirecting output in Windows cmd prevents second thread from doing anything
in thread Redirecting output in Windows cmd prevents second thread from doing anything

Thank you SimonPratt, The code you have suggested is very elegant!
  • Comment on Re^2: Redirecting output in Windows cmd prevents second thread from doing anything

Replies are listed 'Best First'.
Re^3: Redirecting output in Windows cmd prevents second thread from doing anything
by SimonPratt (Friar) on Jan 16, 2016 at 08:28 UTC

    You're welcome :-)

    Not sure if you've noticed, but the solution I provided is capable of having the number of threads dialled up and down very easily. In fact, with very minor modifications, you can even create a non-threaded script (be sure to remove use threads and use Thread::Queue when you do this). I strongly suggest that you do this for testing (make sure to run your full workload, rather than just a print statement) - It will let you know if threading is actually helpful for your workload and if so let you dial in the optimal number of threads pretty rapidly.