Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^12: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?

by bulk88 (Priest)
on Aug 29, 2012 at 21:04 UTC ( #990570=note: print w/ replies, xml ) Need Help??


in reply to Re^11: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend?

The perl context is passed around as pTHX and aTHX as a C param. Only legacy/abandoned XS code and the C Lib emulators in Perl call Perl_get_context() nowadays. Not using PERL_NO_GET_CONTEXT for all XS code in the last 10 years is a sin. Then again, most CPAN authors don't care (I'm staring at you Win32:: namespace).


Comment on Re^12: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
Re^13: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
by BrowserUk (Pope) on Aug 29, 2012 at 22:12 UTC
    The perl context is passed around as pTHX and aTHX as a C param.

    That's even worse.

        Why?
        1. Because all that should be needed (on windows) is
          #define PERL_GET_CONTEXT TlsGetValue(PL_thr_key) #define PERL_SET_CONTEXT(t) TlsSetValue(PL_thr_key, (t))

          Quite why those calls are bracketed to preserve information from a previous error is strange.

          What previous error have we ignored -- by continuing to this piece of code -- that we want to retain the extended error information for?

          And what are we going to do with that retained information? And when?

        2. Because you should only need to set or get it in those functions that use it.

          And most of the functions that currently cart it about, don't use it.

          Other than to pass it on to other functions they call, which also don't use it, but need to pass it on to the functions they call ...

          Why not just get/set it in only those functions that use it?

          The answer is apparently TLS is slow on on *nix, so this blunderbuss solution is the best option.

          Despite that, from what I can see, Perl_get/set_context isn't called many places, or very often. But it is littered all over the source code -- just in case. Aarg!


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        RIP Neil Armstrong

        div/blockquote
Re^13: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
by Anonymous Monk on Aug 29, 2012 at 23:45 UTC

    Not using PERL_NO_GET_CONTEXT for all XS code in the last 10 years is a sin.

    Right, its a sin not to posses secret knowledge -- PERL_NO_GET_CONTEXT site:perldoc.perl.org

    Then again, most CPAN authors don't care (I'm staring at you Win32:: namespace).

    Right, because non-threaded perls are the bees-knees on win32, and PERL_NO_GET_CONTEXT is reported to all these non-caring sharers of code ( PERL_NO_GET_CONTEXT site:rt.cpan.org, )

      Right, its a sin not to posses secret knowledge
      So what you're saying is that its a sin to have a facility that has been fully documented in perlguts.pod since 5.6.0, 12 years ago?

      Dave.

        So what you're saying is that its a sin to have a facility that has been fully documented in perlguts.pod since 5.6.0, 12 years ago?

        Fully documented?

        Calling this a sin and saying cpan authors (esp Win32) don't care, even if I insert the missing smiley, is rude balooney.

        Trying to turn around , my merely sarcastic reply, back at me is troll excrement.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2014-10-25 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls