develooper Front page | perl.perl5.porters | Postings from November 2003

Config::myconfig() fails under ithreads

Thread Next
Stas Bekman
November 15, 2003 12:02
Config::myconfig() fails under ithreads
Message ID:
% perl-5.8.1-ithread -le 'use threads; require Config; \
   threads->new(sub { })->detach; print Config::myconfig()'
Modification of a read-only value attempted at 
/home/stas/perl/5.8.1-ithread/lib/5.8.1/i686-linux-thread-multi/ line 88.

it was reported by Juanma Barranquero on the modperl dev list. Juanma is 
running a threaded mod_perl 2.0, but as you can see the problem is easy to 
reproduce with just creating one ithread in plain perl.

As Juanma points out the problem comes from:

   our $summary : unique = ...

in, because the 'unique' attribute has the effect of making the
global readonly when the first new interpreter is cloned (for
example, when the first new thread is created). (from the perlfunc manpage)

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About