develooper Front page | perl.perl5.porters | Postings from June 2008

RE: IPC::Run [was: This Week on perl5-porters - 1-6 June 2008]

Thread Previous | Thread Next
Jan Dubois
June 17, 2008 18:43
RE: IPC::Run [was: This Week on perl5-porters - 1-6 June 2008]
Message ID:
On Tue, 17 Jun 2008, Barrie Slaymaker wrote:
> The need for pipes at the child end is because TCP sockets on Win32 seem
> to lose any unsent data from the child on child exit unless the child
> actually close()es the filehandle, which is not common practice.
> Are Win32 pipes select()able now, in modern Windows and/or perls?

No, they are not, and I assume never will be. The whole select()
mechanism is really foreign to Windows internals. While winsock tries to
copy the POSIX API, the actual implementation is not a bitmap if file
ids, but an unsorted list of file handles. This makes the actual
select() implementation rather inefficient once you specify more than a
few handles (instead of random access by file id into a bitmap you now
have a linear search through a list of handles).

The "proper" way to do asynchronous I/O in Windows is to use I/O
completion ports:

They will work for files, sockets, named pipes, mailslots. I'm not sure
how we could/should use them in Perl.  I also think they'll only be
available on Windows 2000 and later (they exist in the NT 3.5 kernel,
but I think they were not exported through the Win32 API layer).


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About