Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.981 2008/08/15 12:33:54 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.982 2008/09/11 19:55:23 mast Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:1064: Inside #if defined(THREADS)
   throw (err);    }    bg_process_running = 0;   }   #endif      mixed background_run (int|float delay, function func, mixed... args)   //! Enqueue a task to run in the background in a way that makes as   //! little impact as possible on the incoming requests. No matter how   //! many tasks are queued to run in the background, only one is run at - //! a time. The tasks won't be starved, though. + //! a time. The tasks won't be starved regardless of server load, + //! though.   //!   //! The function @[func] will be enqueued after approximately @[delay]   //! seconds, to be called with the rest of the arguments as its   //! arguments.   //! - //! The function might be run in the backend thread if no thread - //! support is available, so it should never run for a long time. - //! Instead do another call to @[background_run] to queue it up again - //! after some work has been done, or use @[BackgroundProcess]. + //! In a multithreaded server the function will be executed in one of + //! the handler threads. The function is executed in the backend + //! thread if no thread support is available, although that + //! practically never occurs anymore.   //! -  + //! To avoid starving other background jobs, the function should never + //! run for a long time. Instead do another call to @[background_run] + //! to queue it up again after some work has been done, or use + //! @[BackgroundProcess]. + //!   //! @returns   //! If the function is queued for execution right away then zero is   //! returned. Otherwise its call out identifier is returned, which can   //! be used with @[find_call_out] or @[remove_call_out].   {    // FIXME: Make it possible to associate the background job with a    // RoxenModule or Configuration, so that report_error etc can log in    // a good place.   #ifdef DEBUG_BACKGROUND_RUN    report_debug ("background_run enqueue %s (%s) [%d jobs in queue]\n",
Roxen.git/server/base_server/roxen.pike:4890: Inside #if constant (thread_create)
   if (a == backend_thread)    return 0;    else if (b == backend_thread)    return 1;    else    return thread_ids[a] > thread_ids[b];    });       int i;    for(i=0; i < sizeof(threads); i++) { +  string|int thread_id = thread_ids[threads[i]]; +  if (intp (thread_id)) thread_id = sprintf ("%x", thread_id);    report_debug("### Thread %s%s:\n", -  (string) thread_ids[threads[i]], +  thread_id,   #ifdef THREADS    threads[i] == backend_thread ? " (backend thread)" : ""   #else    ""   #endif    );    report_debug(describe_backtrace(threads[i]->backtrace()) + "\n");    }       report_debug ("### Total %d Pike threads\n\n", sizeof (threads));