in reply to Managing a long running server side process using CGI
Might not be exactly what you need, but I'm sure it'll give you a decent kick-start.
Cheers, Darren :)