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 pitrou
Recipients giampaolo.rodola, gvanrossum, pitrou, yselivanov
Date 2017-11-07.15:52:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510069927.78.0.213398074469.issue31960@psf.upfronthosting.co.za>
In-reply-to
Content
> So imagine a Future `fut` is completed. And we call `fut.add_done_callback()` in different contexts with different active event loops.  With your suggestion we'll schedule our callbacks in different loops.

I'm wondering: does this situation occur in practice?  Since Future isn't threadsafe, is there really a point in using it from several loops at once?

> Ideally you should use `loop.create_future()` when you can (and in libraries you usually can do that) to always make it explicit which loop your Future is attached to.

Unfortunately that's not possible in our case.  Short version: we are using Tornado which creates a asyncio Future eagerly, see https://github.com/tornadoweb/tornado/blob/master/tornado/locks.py#L199
History
Date User Action Args
2017-11-07 15:52:07pitrousetrecipients: + pitrou, gvanrossum, giampaolo.rodola, yselivanov
2017-11-07 15:52:07pitrousetmessageid: <1510069927.78.0.213398074469.issue31960@psf.upfronthosting.co.za>
2017-11-07 15:52:07pitroulinkissue31960 messages
2017-11-07 15:52:07pitroucreate