httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Croteau, Beau" <>
Subject RE: Apache Thread Creation/Destroy Problem
Date Thu, 14 Jun 2007 15:44:54 GMT
I'm sorry, I don't understand the question.

Mod_gsoap hooks in as such:
static void
gsoap_hooks(apr_pool_t * p)
    // I think this is the call to make to register a handler for method
calls (GET PUT et. al.).
    // We will ask to be last so that the comment has a higher tendency
    // go at the end.
    ap_hook_handler(gsoap_handler, NULL, NULL, APR_HOOK_LAST);

    //Register a handler for post config processing 
    ap_hook_post_config(gsoap_init, NULL, NULL, APR_HOOK_MIDDLE);

static const command_rec gsoap_cmds[] = {
    AP_INIT_TAKE1("SOAPLibrary",    ///< directive name
                  (command_function_interface) cmd_SoapLibrary, ///<
config action routine
                  NULL,         ///< argument to include in call
                  ACCESS_CONF,  ///< where available
                  "SOAP shared Library that will be dynamically loaded.
- 1 argument (path)"    ///< directive description
    AP_INIT_TAKE1("SupportLibrary", ///< directive name
                  (command_function_interface) cmd_SupportLibrary,  ///<
config action routine
                  NULL,         ///< argument to include in call
                  ACCESS_CONF,  ///< where available
                  "additional library that must be dynamically loaded -
1 argument (path)"  ///< directive description

module AP_MODULE_DECLARE_DATA gsoap_module = {
    gsoap_create_dir_config,    /* per-directory config creator */
    gsoap_merge_dir_config,     /* dir config merger */
    gsoap_create_server_config, /* server config creator */
    gsoap_merge_server_config,  /* server config merger */
    gsoap_cmds,                 /* command table */
    gsoap_hooks,                /*hooks */

We register as a "SOAPLibrary" with several other "SupportLibrary"'s

Inside of our SOAPLibrary we use CreateThread to create multiple threads
to do various tasks.  Inside one of these threads we want to execute an
action that is detached, we don't care what happens inside the thread
and we want to be able to continue processing.

In my logs I see:
{8416,11748}- Successfully disconnected from performance database.

8416 is the parent apache process.  11748 is the thread ID for the
asynchronously executing thread.  The message signifies that the thread
is going through the destructor code for one of the objects it
possesses, which means that it is exiting.

But when I run the following command:
handle -a -p 8416 | find "11748"

I get:
17E0: Thread        httpd.exe(8416): 11748

This means that the thread handle isn't being released for some reason.
When we let it run over time it continues to grow the thread-handle

-----Original Message-----
From: Nick Kew [] 
Sent: Thursday, June 14, 2007 11:29 AM
Subject: Re: Apache Thread Creation/Destroy Problem

On Thu, 14 Jun 2007 11:15:41 -0400
"Croteau, Beau" <> wrote:

> I'm running the following code inside of an apache module:

You keep asking the same thing, but we need more information
to say anything useful.

[14:29] <crobe03> Does anybody have any idea why thread handles would
be leaked inside of an 
[14:29] <crobe03> +apache module using APR but not in a stand-alone
program using the same code?
[14:31] <niq> where are they created?
[14:31] <crobe03> we have a web service that utilizes mod_gsoap
[14:32] <niq> *where* are they created?  Which of apache's hooks?

So for the third time, where are they created?
If you ignore me, I'll be happy to ignore you.

Nick Kew

Application Development with Apache - the Apache Modules Book

View raw message