Forums Register Login

Apache's XML-RPC and Threads

+Pie Number of slices to send: Send
I'm creating an XML-RPC server using Apache's implementation and creating several handlers that search COBOL files and return results. Long story short, the handler may not return for quite some time. Since Apache's XML-RPC implementation appears to not spawn a new thread for each incoming request, I believe this will result in delays or deadlock when it waits for the handler to return. How can I prevent this from happening? I don't want the server to be stuck waiting on a handler that's performing a time consuming task, yet the handler can't return with a result until that task is finished. What do I do?
+Pie Number of slices to send: Send
I found the answer myself looking through the source code and running it in a debugger for observation. They use a worker pool and reuse them as new requests come in to handle them asynchronously. If none are available and if they're below their limit on Threads they create a new one, otherwise an exception gets thrown.

Now I just have to figure out how to implement my own pool of Threads to use for the I/O, but that's beyond the scope of this forum so I won't even bother asking.
Crusading Chameleon likes the size of this ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 873 times.
Similar Threads
how to implement XML-RPC
Soap without web services
Binding Endpoint to HTTPS problem
Connectivity to External System
How do you execute new code in an existing Thread?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 02:09:34.