Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:443: Inside #if undefined(NO_SLOW_REQ_BT)
  // This is a system to dump all threads whenever a request takes   // longer than a configurable timeout.      protected Pike.Backend slow_req_monitor; // Set iff slow req bt is enabled.   protected float slow_req_timeout, slow_be_timeout;      protected void slow_req_monitor_thread (Pike.Backend my_monitor)   {    // my_monitor is just a safeguard to ensure we don't get multiple    // monitor threads. -  Roxen.name_thread(this_thread(), "Slow request monitor"); +  Roxen.name_thread(this_thread(), "Slow Request Monitor");    while (slow_req_monitor == my_monitor)    slow_req_monitor (3600.0);    Roxen.name_thread(this_thread(), 0);   }      protected mixed slow_be_call_out;      protected void slow_be_before_cb()   {   #ifdef DEBUG
Roxen.git/server/base_server/roxen.pike:836:   {    if (query("numthreads") <= 1) {    set( "numthreads", 1 );    report_warning (LOC_S(1, "Starting one thread to handle requests.")+"\n");    } else {    report_notice (LOC_S(2, "Starting %d threads to handle requests.")+"\n",    query("numthreads") );    }    array(object) new_threads = ({});    for(; number_of_threads < query("numthreads"); number_of_threads++) -  new_threads += ({ do_thread_create( "Handle thread [" + +  new_threads += ({ do_thread_create( "Handle Thread [" +    number_of_threads + "]",    handler_thread, number_of_threads ) });    handler_threads += new_threads;   }      protected int num_hold_messages;   protected Thread.Condition hold_wakeup_cond = Thread.Condition();   // Note: There are races in the use of this condition variable, but   // the only effect of that is that some handler thread might be   // considered hung when it's actually waiting on hold_wakeup_cond, and
Roxen.git/server/base_server/roxen.pike:909:       int blocked_threads = number_of_threads - threads_on_hold;    int threads_to_create = numthreads - threads_on_hold;       THREAD_WERR("Releasing " + threads_on_hold + " threads on hold");    cond->broadcast();       if (threads_to_create > 0) {    array(object) new_threads = ({});    for (int n = 0; n < threads_to_create; number_of_threads++, n++) -  new_threads += ({ do_thread_create( "Handle thread [" + +  new_threads += ({ do_thread_create( "Handle Thread [" +    number_of_threads + "]",    handler_thread, number_of_threads ) });    handler_threads += new_threads;    report_notice ("Created %d new handler threads to compensate "    "for %d blocked ones.\n", threads_to_create, blocked_threads);    }    }    else {    THREAD_WERR("Ignoring request to release handler threads during stop");    return;
Roxen.git/server/base_server/roxen.pike:6157:   constant cdt_poll_interval = 5; // Seconds.   constant cdt_dump_seq_interval = 60;      string cdt_directory, cdt_filename;      Thread.Thread cdt_thread;   int cdt_next_seq_dump;      void cdt_poll_file()   { -  Roxen.name_thread(this_thread(), "Dump thread file monitor"); +  Roxen.name_thread(this_thread(), "Dump Thread File Monitor");    while (this && query ("dump_threads_by_file")) {    if (array(string) dir = r_get_dir (cdt_directory)) {    if (has_value (dir, cdt_filename)) {    r_rm (cdt_directory + "/" + cdt_filename);    describe_all_threads();    }    else if (time() >= cdt_next_seq_dump) {    dir = glob (cdt_filename + ".*", dir);    if (sizeof (dir)) {    string file = dir[0];