non-blocking PIPE read on Windows

Durumdara durumdara at gmail.com
Fri Aug 4 04:17:22 EDT 2006


Hi !

Sorry, but I want to share my experiences. I hope this help to you.

I think that specialized MSWindows based services too complicated. They have
to many bug possibilites.
So I trying with normal, "in python accessable" pipes. I see that with
flush(), and some of the bintotext tricks I can use the
subprocess/masterprocess communication.
Ok, this is not asynchronous. I can send some job to sp(s), and I can
receive the report from sp(s).
But with threading I can create non-blocking communication.

You can see in the example: the PipeBPPThr define a pipe based process-pool
thread.
This can communicate with a subprocess, can send/receive jobs, etc.

If you collect these threads, and write a process pool object, you can
handle all of the communications with one object.

I hope to these examples can help to you.

If not, you can try with wm_copydata messages in Windows.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/dataexchange/datacopy/usingdatacopy.asp
This way of data exchanging is based on the message handling/sending.

dd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060804/a11f8ee2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CustPPThread.py
Type: text/x-python
Size: 1509 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20060804/a11f8ee2/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppbpt_sub.py
Type: text/x-python
Size: 240 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20060804/a11f8ee2/attachment-0001.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PipeBPPThr.py
Type: text/x-python
Size: 2053 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20060804/a11f8ee2/attachment-0002.py>


More information about the Python-list mailing list