Re: Making Event work for Win32

[email protected] (Nick Ing-Simmons)
Newsgroups perl.loop
Organization via, but not speaking for : Texas Instruments Ltd.
Message-ID <[email protected]>
Paul Moore <[email protected]> writes:
>I thought I'd look at putting my coding where my mouth is and seeing what would
>be involved in getting Event working on Win32.
>
>Basically, it looks like the necessary changes could be pretty straightforward -
>the system-specific stuff is localised in c/unix_io.c (and a bit in c/signal.c -
>what's rsignal()?) I could probably hash up an IO watcher based on
>MsgWaitForMultipleObjects() -- assuming that I can get from a Perl file object
>to a Win32 HANDLE (I'm pretty sure I can). 

You can:  

long
Lang_OSHandle(fd)
int fd;
{
#ifdef WIN32
 return win32_get_osfhandle(fd);
#else
 return fd;
#endif
}

>But there are two problems there -
>first, Win32 waits on file HANDLEs are "discouraged" (I quote the
>documentation...) - you;re supposed to use asynchronous IO instead. 

But MS's own C "stdio" runtime (which perl currently uses) cannot work with 
asynchronous IO.

-- 
Nick Ing-Simmons <[email protected]>
Via, but not speaking for: Texas Instruments Ltd.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.