Forum

Posted by
ITANI Eiichiro  -  November 2012
Hi all, I'm now rewriting fastcgi module, and trying to implement
function to limit max process for a fastcgi application(ex..don't start
more than 5 PHP process).

My code may be wrongly written, but on thread_enaled server, code
like below seems to lock server.

object app_handler;
while(1) {
  app_handler = pick_free_app_process();
  if (app_handler)
    break;
  sleep(0.1);   
}

pick_free_app_process() check for managed processes, and
return not busy one at that time.
I can't see why, but anyway above code not work well.

And I know, that code will bring more problem when server
running without threads.

So could you give me an advice, how should I write a routine
wait for a resource being freed on threaded/non-threaded server?
 
Posted by
Erik Allemann  -  November 2012
Just to let you know that the person best suited to answer your question (Grubba) is out of office this week and next.
 
Posted by
ITANI Eiichiro  -  November 2012
Hi Erik-san.  Thank you for your response.

After I re-read document, I found Roxen.http_try_again().
I add that return more upper level of stack, and It looks working
nicely.

But I'm looking forward to hear answer form expert person, too  :-)
 
1
Search this thread: