Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I was checking forks.pm to make sure it will run under 5.8.1 (it will) and finally looked at the problem of running it under 5.6.x (it doesn't).

This is basically the problem:

share( $variable );
The share subroutine is actually an XS routine that has this special prototype:
PROTOTYPE: \[$@%]
This prototype was introduced somewhere in the 5.7 track. So in 5.6.x I can't use that (I verified this on p5p). Simply removing the prototype and then having to specify a reference when calling share(), works:
share( \$variable );
Of course, it doesn't work in 5.8.x then, but I think that's fixable. But then the user's source code becomes incompatible with the real threads module.

So before I start doing that, I figure I put the dilemma to the Monks. I see the following options:

  • Forget about supporting pre 5.8.x
    This is sad, because one of the reasons for me to develop forks.pm was to allow people to try out threaded programming in 5.6.x without having to upgrade. The only advantage to this proposal would be that you do not need a threaded 5.8.x perl to be able to run (as opposed to threads.pm, which needs perl with threads enabled).

  • Support 5.6.x, forces references everywhere
    This would make the user's source incompatible with current threads and forks users. So if you would want to migrate to "true" threads, you would need to change your code with every call to share(), lock(), cond_wait(), etc. But it would allow you to migrate from 5.6.x to 5.8.x without any problem.

  • Support 5.6.X, force references in 5.6.x, force direct otherwise
    This would mean that when code using forks is migrated from 5.6.x to 5.8.x or higher, it stops working because you need to remove the reference from each call to share(), lock() etc.
Any suggestions with regards to this dilemma are deeply appreciated.

Liz

Update
It seems possible to use a source filter for 5.6.x. I think I'll give that a try. Thanks everyone for their feedback!

Update 2

The URL

    http://www.liz.nl/CPAN/forks-0.04.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/E/EL/ELIZABETH/forks-0.04.tar.gz
  size: 27883 bytes
   md5: 5855b7f32f260d5ed04b3a34671f1866

No action is required on your part
Request entered by: ELIZABETH (Elizabeth Mattijsen)
Request entered on: Mon, 11 Aug 2003 00:37:06 GMT
Request completed:  Mon, 11 Aug 2003 00:45:48 GMT

In reply to Forks.pm dilemma by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (9)
    As of 2014-07-10 18:01 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (215 votes), past polls