|Think about Loose Coupling|
threads->create hangsby duane_ellis2 (Initiate)
|on Aug 14, 2015 at 23:40 UTC||Need Help??|
duane_ellis2 has asked for the wisdom of the Perl Monks concerning the following question:
I have a problem on win32 (64bit win 7, perl v5.20.2, active state), where threads->create() hangs.
I am looking for debug pointers.
The code launches two processes: Process (1) a background process, and process(2) is GDB, the gdb target talks to the background process via a socket, I am creating an automated sw test environment, I need to control, interact and capture output (stdout) from the processes.
I'm using IPC::Open3() to create both processes processes, like this:
To process the stdout, I create a reader thread like this:
The above works quite well when I run one sub process. It locks up (the create call does not return) if I have two sub processes.
My only means to Debug is via print() - tells me that the call to threads->create() does not return, and print statement I put before threads->create() occurs, the after does not. And the print statement I put at the entry to the reader_thread never happens,
To be clear, this works a few times then does not work again.
Any suggestions how to dig deeper and figure out what I am doing wrong. Often, I insert print statements into various PM modules, but - threads are not perl, they are native code.
The reader thread is quite simple: