Non-blocking IO and threadsby PhillyR (Acolyte)
|on Oct 06, 2011 at 16:37 UTC||Need Help??|
PhillyR has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to utilize threads and non-blocking IO but have run into a stumbling block. I have a separate thread monitoring STDIN via Term::Readkey. After some time I create another thread to do non-related processing but this thread hangs at creation time until something happens (i.e. a key is pressed) in the first thread (read_in). Am I creating threads incorrectly or is there something else blocking the proc_it thread below? Code was modified from a nonblocking IO post by zentara. This code will hang at count = 10 until something is read from the command prompt. How do I avoid this block?