Author vstinner
Recipients gvanrossum, vstinner, yselivanov
Date 2014-07-17.16:10:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks like asyncio does not suppport fork() currently: on fork(), the event loop of the parent and the child process share the same "self pipe".

import asyncio, os
loop = asyncio.get_event_loop()
pid = os.fork()
if pid:
    print("parent", loop._csock.fileno(), loop._ssock.fileno())
    print("child", loop._csock.fileno(), loop._ssock.fileno())

parent 6 5
child 6 5

I'm not sure that it's revelant to use asyncio with fork, but I wanted to open an issue at least as a reminder.

I found the "self pipe" + fork issue when reading the issue #12060, while working on a fix for the signal handling race condition on FreeBSD: issue #21645.
Date User Action Args
2014-07-17 16:10:45vstinnersetrecipients: + vstinner, gvanrossum, yselivanov
2014-07-17 16:10:45vstinnersetmessageid: <>
2014-07-17 16:10:45vstinnerlinkissue21998 messages
2014-07-17 16:10:45vstinnercreate