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:
The share subroutine is actually an XS routine that has this special prototype:share( $variable );
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:PROTOTYPE: \[$@%]
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.share( \$variable );
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.
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Forks.pm dilemma
by dragonchild (Archbishop) on Aug 07, 2003 at 16:01 UTC | |
by liz (Monsignor) on Aug 07, 2003 at 16:24 UTC | |
by Courage (Parson) on Aug 09, 2003 at 14:37 UTC | |
by liz (Monsignor) on Aug 09, 2003 at 16:56 UTC | |
by Courage (Parson) on Aug 09, 2003 at 19:28 UTC | |
Re: Forks.pm dilemma
by Juerd (Abbot) on Aug 07, 2003 at 17:42 UTC | |
by liz (Monsignor) on Aug 07, 2003 at 18:18 UTC | |
by Juerd (Abbot) on Aug 07, 2003 at 18:31 UTC | |
Re: Forks.pm dilemma
by Kageneko (Scribe) on Aug 07, 2003 at 16:58 UTC | |
by liz (Monsignor) on Aug 07, 2003 at 18:11 UTC | |
by Kageneko (Scribe) on Aug 07, 2003 at 18:14 UTC | |
by Kageneko (Scribe) on Aug 08, 2003 at 18:20 UTC | |
Re: Forks.pm dilemma
by BrowserUk (Patriarch) on Aug 07, 2003 at 17:07 UTC | |
Re: Forks.pm dilemma
by simonflk (Pilgrim) on Aug 11, 2003 at 13:54 UTC |
Back to
Meditations