Author gdr@garethrees.org
Recipients davin, dtasev, gdr@garethrees.org, sbt, serhiy.storchaka
Date 2017-07-14.09:53:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500026011.55.0.916700998032.issue30919@psf.upfronthosting.co.za>
In-reply-to
Content
If you need the 2.7 behaviour (anonymous mappings) in 3.5 then you can still do it, with some effort. I think the approach that requires the smallest amount of work would be to ensure that subprocesses are started using fork(), by calling multiprocessing.set_start_method('fork'), and then monkey-patch multiprocessing.heap.Arena.__init__ so that it creates anonymous mappings using mmap.mmap(-1, size).

(I suggested above that Python could be modified to create anonymous mappings in the 'fork' case, but now that I look at the code in detail, I see that it would be tricky, because the Arena class has no idea about the Context in which it is going to be used -- at the moment you can create one shared object and then pass it to subprocesses under different Contexts, so the shared objects have to support the lowest common denominator.)
History
Date User Action Args
2017-07-14 09:53:31gdr@garethrees.orgsetrecipients: + gdr@garethrees.org, sbt, serhiy.storchaka, davin, dtasev
2017-07-14 09:53:31gdr@garethrees.orgsetmessageid: <1500026011.55.0.916700998032.issue30919@psf.upfronthosting.co.za>
2017-07-14 09:53:31gdr@garethrees.orglinkissue30919 messages
2017-07-14 09:53:31gdr@garethrees.orgcreate