Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Re: Re: Ithreads and XS information wanted

by Joost (Canon)
on May 21, 2003 at 08:29 UTC ( #259672=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Ithreads and XS information wanted
in thread Ithreads and XS information wanted

First off, thanks for your replies.

As long as XS code only allocates its own data structures each time it is invoked (no 'static' or global variables), and only changes data passed in using the official Perl API, XS code will function propertly under an ithreads environment.

So that means that C static variables are shared, but I can use perl variables in the normal way, right? Are there any specific issues with accessing :shared perl variables from XS?


-- #!/usr/bin/perl -np BEGIN{@ARGV=$0}s(^([^=].*)|=)()s; =Just another perl hacker\

Replies are listed 'Best First'.
Re: Re: Re: Re: Ithreads and XS information wanted
by MarkM (Curate) on May 21, 2003 at 13:57 UTC

    Always follow the API. Specifically this means that you should respect get magic before fetching the value of a variable and set magic after storing a value. get and set magic is used to push shared data back and forth between an interpreter allocated only to hold shared data.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259672]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2016-10-22 14:02 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (294 votes). Check out past polls.