in reply to Thread::Pool and Template Toolkit

In addition to anonymonk's wise council, be aware. There appear to be two quite different versions of Thread::Pool on cpan. version 0.1 was designed for use with 5005threads (pthreads) and almost certainly won't do anything useful in conjunction with iThreads as found in perls 5.8.0 and later.

The other version is liz' v0.32. If this is the version you are trying to use, please read the very prominent "Note of caution" at the top of the "Description" section.

Beyond that, my copy of of Algoritm::ESP seems to be acting up...can you help?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: Thread::Pool and Template Toolkit
by perldragon80 (Sexton) on Aug 07, 2004 at 06:51 UTC
    Version is v0.32, and I have compiled perl 5.8.5 with threading, just to set your minds at ease.

    Ok, so apparently people aren't enthused with vague problem listings, and poor problem descriptions, but I thought this was the monastery....don't people go to places of faith and wisdom with the silliest of questions hoping for an answer that can't possibly be given by someone who isn't as reverant or intelligent as they would have you believe???....Anyway, I digress.


    I suppose my situation isn't easily explained or easily understood, but I will try a little better next time, after reading the "how not to get chastised" help faq (for the 2nd time no less, you would think I would learn my lesson) :(...

      Threading problems are notoriously difficult and on top of that Perl's implementation is probably still buggy. It's very hard to give you a helpful answer without seeing the code of the script and the template(s).

      I think the best thing for you to do is to cut the offending program back to the smallest example that still demonstrates the bug. If the problem isn't clear by then, feel free to post the code here for people to look at. I'm sure the monks will be happy to help you out.

        Ok here a code snippet to demonstrate the issue. If I uncomment Thread::Pool I don't see anything in the web browser, but the logs don't show any error. As soon as I comment it out I see the expected template display:

        CGI code
        #!/usr/bin/perl -w use strict; use CGI; #use Thread::Pool; use Template; my $q = new CGI; print "Content-type: text/html\n\n"; my $file = 'template.html'; my $vars = { message => "Hello World\n" }; my $template = Template->new({ INCLUDE_PATH => $ENV{DOCUMENT_ROOT} . '/t +emplates' }); $template->process($file, $vars) || die "Template process failed: ", $template->error(), "\n";


        template.html:
        <html lang="en"> <head> <title>Template Thread Test</title> </head> <body> This is a test, [% message %] </body> </html>