Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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?

Joost

-- #!/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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://259672]
help
Chatterbox?
[hippo]: karlgoethebier, Ich habe kein Deutsch.
[Corion]: choroba: A Bembel is a traditional pottery ware, which is only(!) used for serving Cider (well, Apfelwein)
[shmem]: choroba: it's hessisch
[Corion]: Not every Krug is a Bembel!
[karlgoethebier]: there is just the mug: 🍺
[Corion]: A Bembel must look like this
[karlgoethebier]: https://de. wikipedia.org/ wiki/Bembel#/ media/File: Bembel_Zum_blauen_ Bock_1978.jpg
[choroba]: as my friend says, Ich stehe Deutsche ver nicht aber klein ;-)
[Corion]: Krug is generic pottery ware for pouring beverages, but a Bembel is painted with that blue paint and contains only (!) Apfelwein
[shmem]: Corion: alas, air too.

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (14)
As of 2017-05-24 08:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?