Re: Making Event work for Win32

2000-03-21 Thread Mark Mielke
On Tue, Mar 21, 2000 at 05:30:04PM +, "Graham Barr" wrote: > On Tue, Mar 21, 2000 at 04:10:45PM +, Nick Ing-Simmons wrote: > > But when Event says "handle is readable" how is perl code going to > > do its IO to read it? - right now <$fh> or even sysread($fh,...) > > call MS stdio to do t

Re: Making Event work for Win32

2000-03-21 Thread Mark Mielke
On Tue, Mar 21, 2000 at 01:43:30PM -, "Moore, Paul" wrote: > From: Joshua N Pritikin [mailto:[EMAIL PROTECTED]] > > 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. > I'

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Graham Barr <[EMAIL PROTECTED]> writes: >On Tue, Mar 21, 2000 at 04:10:45PM +, Nick Ing-Simmons wrote: >> But when Event says "handle is readable" how is perl code going to >> do its IO to read it? - right now <$fh> or even sysread($fh,...) >> call MS stdio to do that - which will fail if Ha

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Graham Barr <[EMAIL PROTECTED]> writes: >On Tue, Mar 21, 2000 at 04:10:45PM +, Nick Ing-Simmons wrote: >> But when Event says "handle is readable" how is perl code going to >> do its IO to read it? - right now <$fh> or even sysread($fh,...) >> call MS stdio to do that - which will fail if Ha

Re: Making Event work for Win32

2000-03-21 Thread Graham Barr
On Tue, Mar 21, 2000 at 04:37:11PM +, Nick Ing-Simmons wrote: > Graham Barr <[EMAIL PROTECTED]> writes: > >> If I understand the code, pe_sys_multiplex basically waits in a poll/select > >> call until something pops up to wake it up. This implies that there is > >> essentially only one waiting

Re: Making Event work for Win32

2000-03-21 Thread Graham Barr
On Tue, Mar 21, 2000 at 04:10:45PM +, Nick Ing-Simmons wrote: > But when Event says "handle is readable" how is perl code going to > do its IO to read it? - right now <$fh> or even sysread($fh,...) > call MS stdio to do that - which will fail if Handles are in async mode. sysread() used the

RE: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Paul Moore <[EMAIL PROTECTED]> writes: >From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED]] >> >> long >> Lang_OSHandle(fd) >> int fd; >> { >> #ifdef WIN32 >> return win32_get_osfhandle(fd); >> #else >> return fd; >> #endif >> } > >On a similar note, I can sort out the socket issue (socket handles

RE: Making Event work for Win32

2000-03-21 Thread Moore, Paul
From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED]] > > long > Lang_OSHandle(fd) > int fd; > { > #ifdef WIN32 > return win32_get_osfhandle(fd); > #else > return fd; > #endif > } On a similar note, I can sort out the socket issue (socket handles not being waitable objects), if I can get from a Per

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Graham Barr <[EMAIL PROTECTED]> writes: >> If I understand the code, pe_sys_multiplex basically waits in a poll/select >> call until something pops up to wake it up. This implies that there is >> essentially only one waiting state, which all watchers have to tie into. In >> other words, if Event i

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Graham Barr <[EMAIL PROTECTED]> writes: > >Ak, Event does rely on there being one place where all events can be waited upon, >with the exception of signals as the will cause the poll to return anyway. Tcl (and hence perl/Tk as I steal it) does this by messing with the "timeout" value to select/p

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Tue, Mar 21, 2000 at 04:10:45PM +, [EMAIL PROTECTED] wrote: > Joshua N Pritikin <[EMAIL PROTECTED]> writes: > >> 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,

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
Joshua N Pritikin <[EMAIL PROTECTED]> writes: >> >> 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 >dire

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Tue, Mar 21, 2000 at 02:09:49PM +, [EMAIL PROTECTED] wrote: > On Tue, Mar 21, 2000 at 02:05:04PM -, Paul Moore wrote: > > Is there a way for Event to cope with two separate alertable-wait type > > calls? My first guess is that there isn't, as I can't see how we'd hook them > > together

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Tue, Mar 21, 2000 at 02:05:04PM +, [EMAIL PROTECTED] wrote: > From: Moore, Paul > > (correct me if this is all wrong...) the event loop waits > > in pe_multiplex (which is basically implemented as > > pe_sys_multiplex). > > This is probably just a Win32 nasty which I'm going to have to de

Re: Making Event work for Win32

2000-03-21 Thread Graham Barr
On Tue, Mar 21, 2000 at 02:05:04PM -, Paul Moore wrote: > From: Moore, Paul > > (correct me if this is all wrong...) the event loop waits > > in pe_multiplex (which is basically implemented as > > pe_sys_multiplex). > > > > This is probably just a Win32 nasty which I'm going to have to deal

RE: Making Event work for Win32

2000-03-21 Thread Moore, Paul
From: Moore, Paul > (correct me if this is all wrong...) the event loop waits > in pe_multiplex (which is basically implemented as > pe_sys_multiplex). > This is probably just a Win32 nasty which I'm going to have to deal with myself, but... If I understand the code, pe_sys_multiplex basically

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Mon, Mar 20, 2000 at 10:33:51PM +, [EMAIL PROTECTED] wrote: > Basically, it looks like the necessary changes could be pretty straightforward - > the system-specific stuff is localised in c/unix_io.c Yes. > (and a bit in c/signal.c - what's rsignal()?) Does Win32 support the unix notion o

RE: Making Event work for Win32

2000-03-21 Thread Moore, Paul
From: Joshua N Pritikin [mailto:[EMAIL PROTECTED]] > > I'd like to see: > > Event->handle(handle => $WIN32_HANDLE, cb => \&callback); > > On Win32, Event::io can be implemented in terms of > Event::handle. Then we get compatibility if people > restrict themselves to Event::io, and the > Win

RE: Making Event work for Win32

2000-03-21 Thread Moore, Paul
From: Joshua N Pritikin [mailto:[EMAIL PROTECTED]] > 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. I'd expect to be *able* to use low-level IO as long as the user has a way

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Tue, Mar 21, 2000 at 12:04:02PM +, [EMAIL PROTECTED] wrote: > On Tue, Mar 21, 2000 at 11:51:38AM -, Paul Moore wrote: > > Actually, this approach looks a bit more complicated than that (but it also > > looks like the way it needs to go -- see below). I need to be able to wait > > on *an

Re: Making Event work for Win32

2000-03-21 Thread Joshua N Pritikin
On Tue, Mar 21, 2000 at 12:23:42PM +, [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 cou

Re: Making Event work for Win32

2000-03-21 Thread Nick Ing-Simmons
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/u

Re: Making Event work for Win32

2000-03-21 Thread Graham Barr
On Tue, Mar 21, 2000 at 11:51:38AM -, Paul Moore wrote: > Actually, this approach looks a bit more complicated than that (but it also > looks like the way it needs to go -- see below). I need to be able to wait > on *any* Win32 "synchronisation object" - not just files. So I need a way to > pa

RE: Making Event work for Win32

2000-03-21 Thread Moore, Paul
From: Paul Moore [mailto:[EMAIL PROTECTED]] > > 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). Actually, this approach looks a bit more complicated than that (but it al