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 sbt
Recipients christian.heimes, gregory.p.smith, sbt, twouters
Date 2012-11-19.22:43:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1353365030.15.0.682380769379.issue16500@psf.upfronthosting.co.za>
In-reply-to
Content
Note that Gregory P. Smith has written

    http://code.google.com/p/python-atfork/

I also started a pure python patch but did not get round it posting it.  (It also implements the fork lock idea.)  I'll attach it here.

How do you intend to handle the propagation of exceptions?  I decided that after

    atfork.atfork(prepare1, parent1, child1)
    atfork.atfork(prepare2, parent2, child2)
    ...
    atfork.atfork(prepareN, parentN, childN)

calling "pid = os.fork()" should be equivalent to

    pid = None
    prepareN()
    try:
        ...
            prepare2()
            try:
                prepare1()
                try:
                    pid = posix.fork()
                finally:
                    parent1() if pid != 0 else child1()
            finally:
                parent2() if pid != 0 else child2()
        ...
    finally:
        parentN() if pid != 0 else childN()
History
Date User Action Args
2012-11-19 22:43:51sbtsetrecipients: + sbt, twouters, gregory.p.smith, christian.heimes
2012-11-19 22:43:50sbtsetmessageid: <1353365030.15.0.682380769379.issue16500@psf.upfronthosting.co.za>
2012-11-19 22:43:50sbtlinkissue16500 messages
2012-11-19 22:43:49sbtcreate