popen in thread on QNX

Jacek Popławski jpopl at interia.pl
Thu Sep 8 16:50:32 CEST 2005


Laszlo Zsolt Nagy wrote:
> - one of your worker threads wants to run a command
> - it creates the argument list and puts it into a message queue
> - woker thread starts to sleep
> - main thread processes the message queue -> it will run popen, put back 
> the file descriptors into the message and wake up the worker thread
> - the worker thread starts to work with the files

Just like I wrote in previous thread ("killing thread after timeout") - 
I am writting application which read command from socket and run it. I 
need to be sure, that this command will not take too much time, so I 
need some kind of timeout, and I need to see its stdout and stderr.

So I run command on separate thread, this thread calls 
os.system(command), main thread takes care about timeout.

popen or fork/execve would be much better than os.system, but they both 
fail on QNX, because os.fork() is not implemented in thread



More information about the Python-list mailing list