in reply to URGENT!!!processing in batch mode

Split your problem into two problems:

  1. Make sure that only one instance of a program is run.
  2. Display a page to watch a long-running process.

Unsurprisingly, merlyn has solved both problems for you already:

  1. Highlander - allow only one invocation at a time of an expensive CGI script
  2. Watching Long Processes Through CGI