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.
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.