XMLRPC calls don't work in threads, or rather, they don't play well with others ! (help)

Steve Ludtke sludtke at bcm.tmc.edu
Mon Sep 30 19:11:09 CEST 2002


Martin v. Loewis wrote:
> Steve Ludtke <sludtke at bcm.tmc.edu> writes:
> 
> 
>>Hi. I've been trying to write a python app that makes somewhat
>>time-consuming XMLRPC calls. I planned to have several calls going at
>>once using threads, but it seems like something in the XMLRPC client
>>code isn't releasing the python interpreter lock properly. 
> 
> 
> This is unlikely. xmlrpclib does not use threads. I don't know what
> xmlrpclib_auth is, so all bets are off.
> 
> If it doesn't use any threading facilities, either, blocking calls
> will occur eventually only in the socket read/write calls, which do
> allow other threads to run, and do release the interpreter lock
> properly.
xmlrpclib_auth just adds a couple of header entries, and calls 
xmlrpclib. No actual functionality changes.  What you describe is what 
I'd expect, but not what I get.

>>Is there something I can do at the Python level to deal with this
>>issue ?
> 
> 
> I'd add print statements at all levels of the code, to see where
> exactly it is blocking.

Already did this. It definitely seems to be the xmlrpclib calls that are 
   preventing the thread switching.    I'll have to see if I can come up 
with a simple demonstration script to show the problem.




More information about the Python-list mailing list