# Xmlrpc and threading

**URL:** <https://www.ruby-forum.com/t/xmlrpc-and-threading/232864>\
**Category:** GNU Radio\
**Created:** [November 1, 2014, 12:20am UTC](https://www.ruby-forum.com/t/xmlrpc-and-threading/232864 "2014-11-01T00:20:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [November 1, 2014, 12:20am UTC](https://www.ruby-forum.com/t/xmlrpc-and-threading/232864/1 "2014-11-01T00:20:15Z")

</div>

I have an application that uses two probes/function\_probe blocks  
and an xmlrpc client.  
Most of the times I see that the two threads are crushing, I guess  
making  
concurrent requests to the SimpleXMLRPCServer.

I googled it and I found that the SimpleXMLRPCServer cannot by default  
handle these cases, but if it is derived by the “\*MixIn” classes you can  
handle concurrent requests.

Is there something obvious and simple that needs to be changed in the  
xmlrpc\_server.xml block?

thanks  
Achilleas

===============

Exception in thread Thread-4:  
Traceback (most recent call last):  
File “/usr/lib64/python2.7/threading.py”, line 811, in  
\_\_bootstrap\_inner  
self.run()  
File “/usr/lib64/python2.7/threading.py”, line 764, in run  
self.\_\_target(_self.\_\_args, \*\*self.\_\_kwargs)  
File “./cdma\_rx1.py”, line 213, in \_Esest\_probe  
self.set\_Esest(val)  
File “./cdma\_rx1.py”, line 280, in set\_Esest  
self.set\_EsN0dB\_est(10_numpy.log10( cp.epsilon + abs(self.Esest)/  
(abs(self.N0est)+cp.epsilon) ) )  
File “./cdma\_rx1.py”, line 296, in set\_EsN0dB\_est  
self.set\_DataEsN0dB\_est(self.EsN0dB\_est + 10\*numpy.log10(  
1.0-self.training\_percent/100.0 ) )  
File “./cdma\_rx1.py”, line 329, in set\_DataEsN0dB\_est  
self.set\_appr\_tcm\_type(2 if (self.DataEsN0dB\_est\<=15.0) else (1 if  
(self.DataEsN0dB\_est\<=20.0) else 0))  
File “./cdma\_rx1.py”, line 455, in set\_appr\_tcm\_type  
self.xmlrpc\_client\_0.set\_tcm\_type\_selector(self.appr\_tcm\_type)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1224, in **call**  
return self.\_\_send(self.\_\_name, args)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1578, in \_\_request  
verbose=self.\_\_verbose  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1264, in request  
return self.single\_request(host, handler, request\_body, verbose)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1289, in single\_request  
self.send\_request(h, handler, request\_body)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1391, in send\_request  
connection.putrequest(“POST”, handler, skip\_accept\_encoding=True)  
File “/usr/lib64/python2.7/httplib.py”, line 871, in putrequest  
raise CannotSendRequest()  
CannotSendRequest

Exception in thread Thread-3:  
Traceback (most recent call last):  
File “/usr/lib64/python2.7/threading.py”, line 811, in  
\_\_bootstrap\_inner  
self.run()  
File “/usr/lib64/python2.7/threading.py”, line 764, in run  
self.\_\_target(_self.\_\_args, \*\*self.\_\_kwargs)  
File “./cdma\_rx1.py”, line 201, in \_N0est\_probe  
self.set\_N0est(val)  
File “./cdma\_rx1.py”, line 273, in set\_N0est  
self.set\_EsN0dB\_est(10_numpy.log10( cp.epsilon + abs(self.Esest)/  
(abs(self.N0est)+cp.epsilon) ) )  
File “./cdma\_rx1.py”, line 296, in set\_EsN0dB\_est  
self.set\_DataEsN0dB\_est(self.EsN0dB\_est + 10\*numpy.log10(  
1.0-self.training\_percent/100.0 ) )  
File “./cdma\_rx1.py”, line 329, in set\_DataEsN0dB\_est  
self.set\_appr\_tcm\_type(2 if (self.DataEsN0dB\_est\<=15.0) else (1 if  
(self.DataEsN0dB\_est\<=20.0) else 0))  
File “./cdma\_rx1.py”, line 455, in set\_appr\_tcm\_type  
self.xmlrpc\_client\_0.set\_tcm\_type\_selector(self.appr\_tcm\_type)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1224, in **call**  
return self.\_\_send(self.\_\_name, args)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1578, in \_\_request  
verbose=self.\_\_verbose  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1264, in request  
return self.single\_request(host, handler, request\_body, verbose)  
File “/usr/lib64/python2.7/xmlrpclib.py”, line 1294, in single\_request  
response = h.getresponse(buffering=True)  
File “/usr/lib64/python2.7/httplib.py”, line 1033, in getresponse  
raise ResponseNotReady()  
ResponseNotReady

---

<div class="post-metadata">

**Author:** ![Achilleas\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Achilleas\_A](https://www.ruby-forum.com/u/Achilleas_A)\
**Post date:** [November 1, 2014, 12:36am UTC](https://www.ruby-forum.com/t/xmlrpc-and-threading/232864/2 "2014-11-01T00:36:22Z")

</div>

HI Achilleas,

You could just write your own class that does that, and modify the  
s and in the .xml. BUT then you yourself are in charge of  
making sure you don’t concurrently access block members in damaging  
ways.  
However, these crashes you see are suboptimal. You should maybe file a  
bug on [gnuradio.org](http://gnuradio.org), so that this doesn’t get lost in time.

Greetings,  
Marcus
