Uri Guttman <[EMAIL PROTECTED]> writes:
>>>>>> "NI" == Nick Ing-Simmons <[EMAIL PROTECTED]> writes:
>
>  NI> The Tk event loop works (after a fashion) on Win32 and is a 
>  NI> self-contained XS module Tk::Event (Tk uses Tk::Event rather than 
>  NI> vice versa). The snag is that 'fileevent' is seriously flawed on 
>  NI> Win32 - e.g. you cannot wait for a 'listen' socket to be readable,
>  NI> nor on pipes, nor console. Basically only 'data' sockets work.
>  NI> The PerlIO stuff is intended to allow that to be fixed the same 
>  NI> way Tcl/Tk fixed it - by using per-handle versions of read() etc. 
>  NI> rather than C run-times flawed faking of UNIX semantics.
>
>well, i need the socket stuff in particular. how does the redmond
>perl/tk handle that?

Er, it depends on the Tk revision for the details as I have tried 
a bunch of different approaches. The fundamental problem is that perl < 5.7.0+
assumes that it can have a FILE * for the thing you are doing IO to. 
It turns out that means that MS's C runtime puts socket into a synchronous
mode that allows read() and provides select() but precludes doing 
Win32 native level WaitXxxxx() calls. The select() is broken for listen
sockets.

>
>what is the status of the perlio stuff? 

Alpha. It seems to work, it will be in 5.7.1 for further testing.
The Win32 lower levels will start being coded sometime on Sunday.
(For now it just uses C runtime read() level call forced into binmode()
which is sufficient for normal perl use but not for Tk.)

>could it be made into a
>standalone XS module for an event core? 

Not if you want to do <$fh> - that is too tied in to 
refrence to a glob which has an {IO} which has a PerlIO * complexity 
of perl's IO. It is not patchable at the XS level.
(One could use TIEHANDLE and PerlIO-in-XS but _I_ would rather fix it right.) 

>if redmond has it own read calls
>with event semantics (as i gather it does), it doesn't sound like it
>would be too hard to make a proper event loop out of that. 

Event loop is natual for Win32. It is <stdio.h> and hence normal 
perl IO which is alien to it.

>would it be
>better to work from event.pm or from perlio as a base? 

I have not looked at guts of Event.pm (i.e. Event.xs) in a while.

>in any case i
>can't (and won't) do it personally. i would need to hire some win32
>expert for this. 

There are very few of those around perl-loop - I am far from an expert 
and I _think_ I am the best we have on the list (real experts please 
speak up!).

>i will let you know when/if this happens and i will
>probably be able to pay very well for it. :)
>
>uri
-- 
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.

Reply via email to