This question is related to the others that I asked for here, mainly regarding sorting huge datasets in memory.
This is basically what I want / have:
A running XMLRPC server is running. This server stores several (32) instances of the Foo class in memory. Each Foo class contains a list pane (which will contain several million entries). There is a service that retrieves data from the database and transfers it to the XMLRPC server. Data is basically a dictionary with keys corresponding to each Foo instance, and values ββis a list of dictionaries, for example:
data = {'foo1':[{'k1':'v1', 'k2':'v2'}, {'k1':'v1', 'k2':'v2'}], 'foo2':...}
Each Foo instance then passes the value corresponding to its key, and the Foo.bar dictionaries are updated and sorted.
class XMLRPCController(xmlrpc.XMLRPC): def __init__(self): ... self.foos = {'foo1':Foo(), 'foo2':Foo(), 'foo3':Foo()} ... def update(self, data): for k, v in data: threads.deferToThread(self.foos[k].processData, v) def getData(self, fookey):
The problem is that when the update function is called in XMLRPCController with a large number of records (for example, 100K +), it stops answering my getData calls until all 32 Foo instances have completed the process_data method. I thought deferToThread would work, but I think I donβt understand where the problem is.
Any suggestions ... I am open to using something else, such as Cherrypy, if it supports this required behavior.
EDIT
@Troy: this is how the reactor works
reactor.listenTCP(port_no, server.Site(XMLRPCController) reactor.run()
As for the GIL, it would be a viable option to change the sys.setcheckinterval () value to something less, so the data lock is released so that it can be read?