<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Courier New";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang="EN-US" link="#0563C1" vlink="#954F72"><div class="WordSection1" style="page:WordSection1;"><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>I’ve got a bit of a problem with copy.deepcopy and using multiprocessing.Queue. <o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>I have an HTTPAPI that gets exposed to add objects to a multiprocessing.Qeue. Source code here: <a href="https://github.com/jmdevince/cifpy3/blob/master/lib/cif/api/handler.py#L283" style="mso-style-priority:99;color:#0563C1;text-decoration:underline;">https://github.com/jmdevince/cifpy3/blob/master/lib/cif/api/handler.py#L283</a><o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>The trouble is, even using deepcopy, my debugging shows that it keeps re-using the same address space on every iteration of the loop (and/or fork since it uses the Forking TCP server mixin). <o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>This is reflected when the reference to that address space gets removed from the Queue. Source code: <a href="https://github.com/jmdevince/cifpy3/blob/master/lib/cif/worker/worker.py" style="mso-style-priority:99;color:#0563C1;text-decoration:underline;">https://github.com/jmdevince/cifpy3/blob/master/lib/cif/worker/worker.py</a><o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>So I submit a few objects very rapidly to the HTTP server. It places them in the queue. For some reason on the second iteration copy.deepcopy stops using new address spaces for deepcopied objects. As such the queue processes that object only once (even though Queue.put() is called repeatedly for the same address space). <o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'>I’ve tried ‘del’ the object before reusing it but it still reallocates to the same address space. I’m at a complete loss. <o:p></o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb2e8><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 THREAD #1-1  WARNING  Got Observable with Object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbdb978><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 THREAD #2-1  WARNING  Got Observable with Object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbdab70><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>2015-10-14 17:03:30 APIHTTP      WARNING  Storing object: <cif.types.observables.fqdn.Fqdn object at 0x7fb26dbcb0f0><o:p></o:p></span></p><p class="MsoNormal" style='margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:"Calibri","sans-serif";'><o:p> </o:p></p></div><img src="http://mandrillapp.com/track/open.php?u=30578881&id=c60aa10b89d74eebb60163f87bf71651" height="1" width="1"></body></html>