[Twisted-Python] sharing a dict between child processes

Waqar Khan wk80333 at gmail.com
Tue Nov 5 23:19:56 MST 2019


Hi,
So, I am writing a twisted server. This server spawn multiple child
processes using reactor spawnProcess that initializes a process protocol.

Now, each of the childprocess receives some REST requests. Each process has
a dict that acts as cache.
Now, I want to share dict across processes.
In general, python has SharedMemoryManager in multiprocessing module which
would have helped.
https://docs.python.org/3/library/multiprocessing.shared_memory.html#multiprocessing.managers.SharedMemoryManager.SharedMemory
But since I am using twisted internal process implementation, how do I
share this dict across the processes so that all the processes use this
common cache?
Thanks
Waqar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/twisted-python/attachments/20191105/675d7405/attachment-0002.html>


More information about the Twisted-Python mailing list