[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modules
Subject:    FW: [apache-modules] Re: Thread
From:       Marco Spinetti <m.spinetti () pisa ! iol ! it>
Date:       2004-01-13 15:00:41
Message-ID: 40040819.7020609 () pisa ! iol ! it
[Download RAW message or body]

Are you sure that it is possible to use pthread inside apache 1.3.x modules?


--Marco



Marco Spinetti wrote:

> Hi all,
>
> I have implemented my module: inside it I start 5 pthreads. Each one 
> starts a different connection.
>
> I'm using apache 1.3.27.
>
> My big problem is if I start apache with:
>
> /usr/local/apache/bin/httpd -X -f /usr/local/apache/conf/httpd.conf -c 
> 'Port 80'
>
> all is ok.
>
> But if I start apache normally (/usr/local/apache/bin/apachectl start) 
> my apache module never returns from pthread_cond_wait.
>
> My code is, if I start one thread inside my module:
>
> ...........
> io_thread_make(&struct_copy[indice_conn], query);
> /*
> io_thread_make starts a thread with pthread.
> My thread executes, at the end, pthread_cond_signal
> */
>
> fprintf(stderr, "8 passo\n");
> if (pthread_mutex_lock(&mutex_conn) == -1) {
>            fprintf(stderr, "[ERROR]\n");
> }
> if (pthread_cond_wait(&cond_conn, &mutex_conn) == -1) {
>            fprintf(stderr, "[ERROR]\n");
> }
> pthread_mutex_unlock(&mutex_conn);
> .................
>
> Am I missing something?
>
>
> Who can give me some advice? If I start apache with -X option all is 
> ok and the module returns from  pthread_cond_wait.
>
>
>
> Thanks
>
> --Marco
>
>
>
>
> Sander Temme wrote:
>
>>> Can I use pthreads inside an apache module?
>>>   
>>
>>
>> Yes, you may if the platform you're running on supports them.
>>
>> S.
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: apache-modules-unsubscribe@covalent.net
> For additional commands, e-mail: apache-modules-help@covalent.net
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: apache-modules-unsubscribe@covalent.net
For additional commands, e-mail: apache-modules-help@covalent.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic