in reply to Re: CGI and Threads
in thread CGI and Threads

Funny you should say that, but v0.1 of the script actually did. And that's why I need to ensure that the threads die after user disconnects. As for scaleability, I do limit number of threads per user, and there is a number of slots allocated to the users, so if there isn't free slot, users request is put in a queue and processed later. Both of those are of course variable, so I can change it depending on needs and resources available.
If you have any alternatives in mind though for parallel cgi processing, I am opened to suggestions.
I have been looking into AJAX solution, but was wondering if there was any exclusively perl solution.

Replies are listed 'Best First'.
Re^3: CGI and Threads
by davido (Cardinal) on Jul 03, 2011 at 20:11 UTC

    Sometimes Perlish solutions are more about stepping back and strategizing than anything else. I don't know much about your site, but is it possible to anticipate what pages will be requested, to hit them and then to cache the results for a period of time such that multiple users could benefit from a single fetch? Even if only one user could benefit, at least that puts you in control of when fetches are being done, rather than doing them real-time on demand.

    How long before a cached result becomes stale is one of the big questions to whether this sort of strategy could work to your benefit, but without knowing more info, it seems like something you could consider.


    Dave