This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gdr@garethrees.org
Recipients davin, dtasev, gdr@garethrees.org, sbt, serhiy.storchaka
Date 2017-07-14.11:49:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500032981.12.0.621587893891.issue30919@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-07-14 11:49:41gdr@garethrees.orgsetrecipients: + gdr@garethrees.org, sbt, serhiy.storchaka, davin, dtasev
2017-07-14 11:49:41gdr@garethrees.orgsetmessageid: <1500032981.12.0.621587893891.issue30919@psf.upfronthosting.co.za>
2017-07-14 11:49:41gdr@garethrees.orglinkissue30919 messages
2017-07-14 11:49:40gdr@garethrees.orgcreate