gSOAP multithreaded?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Torsten Mueller

    #1

    gSOAP multithreaded?

    Does anybody use gSOAP 2.7 in a multithreaded environment? Are the
    gSOAP functions (especially soap_serve) really thread safe? I use
    pthreads on Solaris.

    The main function has a loop like this:

    while (true) {
    int r=soap_accept(s oap);
    if (r>=0) {
    pthread_create( &tid,NULL,
    (thread_proc)pr ocess_request,
    soap_copy(soap) );
    }
    }

    And the process_request function looks like this:

    static void* process_request (struct soap* soap)
    {
    soap_serve(soap );
    soap_destroy(so ap);
    soap_end(soap);
    soap_done(soap) ;
    soap_free(soap) ;

    return NULL;
    }

    This code comes from one of the gSOAP examples but I don't trust him.
    The example was designed just for one call. I have ten thousands of
    calls, and perhaps 100 at the same time.

    T.M.
Working...