gSOAP multithreaded?

T

Torsten Mueller

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top