Re: Making Event work for Win32

[email protected] (Joshua N Pritikin)
Newsgroups perl.loop
Message-ID <[email protected]>
On Tue, Mar 21, 2000 at 12:23:42PM +0000, [email protected] wrote:
> 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.

I see no compelling reason to suggest using MS's stdio.  If possible,
I'd like to avoid as many compatibility layers as possible and talk
directly to low-level APIs.

-- 
"Never ascribe to malice that which can be explained by stupidity."
                           via, but not speaking for Deutsche Bank
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.