in reply to
Highlander - allow only one invocation at a time of an expensive CGI script
I should point out that the need for this snip of code is "my fault" :-). The load comes from a SQL query and not from the perl code. Mod_perl was not an option here as eventually the code will be moved to a machine that does not run mod_perl (excuses, excuses). Regardless, since the query is what creates the load little could be gained by running it under mod_perl with respect to the load generated from the functionality. This is typically not the case as mod_perl often yeilds huge perfomance increases.