develooper Front page | perl.perl5.porters | Postings from July 2012

Re: pp_select && obscure OS

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
July 2, 2012 02:26
Subject:
Re: pp_select && obscure OS
Message ID:
20120702092609.GI9069@plum.flirble.org
On Sat, Jun 30, 2012 at 07:54:48AM +1000, NormW wrote:
> G/M from Au,
> On 29/06/2012 3:37 PM, Tony Cook wrote:
> > On Fri, Jun 29, 2012 at 11:40:11AM +1000, NormW wrote:
> 
> > Windows Sockets uses the same data structure for the fd sets, perhaps
> > you could use that as a reference.
> >
> > See win32_select() in win32/win32sck.c
> Thanks for the consideration given and the time to reply. I was always 
> of a mind that Windows did everything its own unique way.
> 
> A quick look at windows_select() shows a completely different mode of 
> operation and its parameter list differs somewhat from that in pp_sys.c 
> but hope I can eventually work out how to use the MACRO's it contains to 
> greatly simplify my coding efforts.

I don't know if the above makes some of your questions moot

On Fri, Jun 29, 2012 at 11:40:11AM +1000, NormW wrote:

> The _BIG_ (obvious) questions for me are:
> 
> a) How to put each sv back into its right place in the stack?
> b. Does stack item carry its own map or just pointers to the common map?

You don't need to. The stack is simply pointers to SV structures allocated
somewhere else. What matters in this case (to the Perl program) is the
contents of the SV structure, not what points to it.

(Because the values aren't returned from select, so don't need to go back on
the stack. The values passed to select are modified in place)

So once the C code in pp_select has a copy of the pointer locally in a
variable, it can modify the SV structure through that pointer, without
needing to worry about the stack.

> c. Is SvSETMAGIC() [a mystery] still needed here? (Perlguts is no help)

Good question. If it's needed for NetWare, it's needed for everything else.
And it's not there. So that might be a general bug. Certainly, it's not
needed specifically for what you're trying to do.

> d. Any other glaring oversights?

Not that I spotted.

Thanks for persevering with this.

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About