thread execution order

Rembrandt Q Einstein hercules.rockefeller at springfield.??.us
Thu Sep 30 09:30:26 EDT 2004


Axel Mittendorf wrote:
> Hi, I have an app that writes text messages into a pipe and reads it out.
> Other programs write into this pipe too. Sometimes the pipe is full and
> my app freezes if it wants to write in that moment. It is not an option
> for me to open the pipe with O_NONBLOCK, so I thought I could
> use threads. Always when something shall be written into the pipe a new
> thread is created. These threads may hang on os.write, but they'll write out
> the data ASAP.

I wouldn't do this with threads.  I'd use select() or similar to see if 
the pipe is writable and if it isn't, buffer internally.



More information about the Python-list mailing list