Message298348
I see now that the default start method is 'fork' (except on Windows), so calling set_start_method is unnecessary.
Note that you don't have to edit multiprocessing/heap.py, you can "monkey-patch" it in the program that needs the anonymous mapping:
from multiprocessing.heap import Arena
def anonymous_arena_init(self, size, fd=-1):
"Create Arena using an anonymous memory mapping."
self.size = size
self.fd = fd # still kept but is not used !
self.buffer = mmap.mmap(-1, self.size)
Arena.__init__ = anonymous_arena_init
As for what it will break — any code that uses the 'spawn' or 'forkserver' start methods. |
|
Date |
User |
Action |
Args |
2017-07-14 11:49:41 | gdr@garethrees.org | set | recipients:
+ gdr@garethrees.org, sbt, serhiy.storchaka, davin, dtasev |
2017-07-14 11:49:41 | gdr@garethrees.org | set | messageid: <1500032981.12.0.621587893891.issue30919@psf.upfronthosting.co.za> |
2017-07-14 11:49:41 | gdr@garethrees.org | link | issue30919 messages |
2017-07-14 11:49:40 | gdr@garethrees.org | create | |
|