So, I have this very complicated program that I'm trying to wedge ithreads into as a means of helping its performance. For some reason a simple module that I am using to do logging seems to not want to print anything to STDERR or STDOUT once a thread is launched.
I thought it may be some blocking due to many things trying to Log() at the same time, so I wrote a seemingly thread-safe Log module that uses Thread::Queue and runs a thread of its own to output logging info. Still, it doesn't seem to work but here's the kicker. If I run from the perl debugger, the Log module seems to output fine. In addition, if I ^Z the perl process and fg to it, it dumps its logging output to the screen. It looks like there's some kind of weird buffering issue that I'm running into. Has anyone seen this? Normally I don't have this issue, but I have a feeling something pre-existing in this program is causing some weird buffering to happen and I'm not sure where to look. There's no calls to sysread/syswrite/ write/select in the code that I'm using, so I'm not sure where the problem might lay. Also the fact that it seems to work fine in debug mode is just bizarre. Any ideas?
