Re: CGI::Fast and ithreads.
[email protected] (zentara)
| Newsgroups | perl.beginners.cgi,perl.ithreads |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 2 May 2006 09:57:12 -0500 (CDT), [email protected] (Mike Pomraning) wrote: >On Tue, 25 Apr 2006, Eugene Kosov wrote: > >> I'm writing a CGI application and am going to use ithreads in order to reduce >> execution time. Is it possible with CGI::Fast? I get segmentation fault every >> time I'm using threads with CGI::Fast. ><<SNIP>> >> [kosov@yoyo ~]$ perl test.pl >> I'm a thread. >> Segmentation fault >> >> What's wrong? Did I forget something to do? > >You forgot to tell us the versions of perl, CGI::Fast, ithreads and >underlying system you're running. :) Others have had a similar problem, >too: > > http://www.fastcgi.com/archives/fastcgi-developers/2004-August/003439.html > >FWIW, I get the same behavior under perl-5.8.4 with CGI::Fast-1.05 and >threads-1.03 atop Linux 2.4: > > $ perl -Mthreads -MCGI::Fast -e 'threads->new(sub{})->join()' > Segmentation fault > >... but that version of "threads" is so old that it's hardly a relevant data >point. Try threads-1.23 or 1.24, available from CPAN. > >I also suggest that you ``use threads'', rather than ``require'' it. >Mike I'll also mention that CGI is "probably" (almost certainly) not thread safe. Even if you do update versions, you will have to be very careful about how you spawn your threads. Generally the threads need to be created before any lines using CGI are called. (Just an educated guess). -- I'm not really a human, but I play one on earth. http://zentara.net/japh.html