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

Config::myconfig() fails under ithreads

Thread Next
From:
Stas Bekman
Date:
November 15, 2003 12:02
Subject:
Config::myconfig() fails under ithreads
Message ID:
3FB6866A.6020907@stason.org
% 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/Config.pm 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 Config.pm, 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
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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