develooper Front page | perl.perl5.porters | Postings from April 2006

Rebuilding XS modules for threaded perl

Thread Next
From:
Peter Scott
Date:
April 25, 2006 17:18
Subject:
Rebuilding XS modules for threaded perl
Message ID:
pan.2006.04.26.00.17.52.907550@PSDT.com
Pardon me for asking an easy question here, but I'm trying to determine
the approach for maintaining a threaded and unthreaded perl concurrently. 
Is it correct that all modules with XS components have to/should be
built both with and without -Dusethreads?  I'm figuring those extra paths
in @INC aren't just for Config.pm.

Assume that I want a bin directory that differs from the most vanilla
configuration only in that it has two perl executables instead of one:
perl5.8.8 and perl5.8.8-thr.  And that I don't care about having different
versions of any other executables like perldoc (they can all be
unthreaded). Is my best strategy to build with -Dusethreads, make install,
mv the binary to perl5.8.8-thr, and then do another build without
-Dusethreads, and do another make install?  It may do a lot of redundant
overwriting, but is it the laziest way to get what I want?

I'm trying to divine the best practice here... I found an earlier, er,
thread of Elizabeth's about this, but there was enough of an impedance
mismatch with what I want that I'm not sure of the outcome.  Also when I
was looking for docs on whether the XS modules need to be reinstalled, I
found a patch from Jarkko (http://xrl.us/k2b8) where text that appeared to
confirm that was removed from threads/shared/shared.pm.

Finally, would the practice for installing CPAN modules in this situation
be:

  perl5.8.8 -MCPAN -e 'install Acme::Degorkulator'
  # Notice .xs being built...
  perl5.8.8-thr -MCPAN -e 'install Acme::Degorkulator'

?  I've read INSTALL and just about every POD on threads I can find, but
I'm having a hard time finding anything definitive for this case.  I could
whip up a patch for INSTALL if desired.

-- 
Peter Scott


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About