Connecting Tech Pros Worldwide Help | Site Map

gSOAP multithreaded?

  #1  
Old March 27th, 2006, 09:55 AM
Torsten Mueller
Guest
 
Posts: n/a
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(soap);
if (r>=0) {
pthread_create(&tid,NULL,
(thread_proc)process_request,
soap_copy(soap));
}
}

And the process_request function looks like this:

static void* process_request (struct soap* soap)
{
soap_serve(soap);
soap_destroy(soap);
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.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
any experience with multithreaded pg apps? Mark Harrison answers 5 November 23rd, 2005 12:52 AM