logoalt Hacker News

12_throw_awayyesterday at 7:31 PM4 repliesview on HN

No, determinstic scheduling is not a property of async python.

Yes, the stdlib asyncio event loop does have deterministic scheduling, but that's an implementation detail and I would not rely on it for anything critical. Other event loops - for instance trio [1] - explicitly randomize startup order so that you won't accidentally write code that relies on it.

[1] https://github.com/python-trio/trio/issues/32


Replies

StableAlkyneyesterday at 8:14 PM

> but that's an implementation detail

That sounds familiar...

https://stackoverflow.com/questions/39980323/are-dictionarie...

KraftyOneyesterday at 8:03 PM

It's been a stable (and documented) behavior of the Python standard library for almost a decade now. It's possible it may change--nothing is ever set in stone--but that would be a large change in Python that would come with plenty of warning and time for adjustment.

show 2 replies
mort96yesterday at 10:24 PM

How do you differentiate between something that "happens to work due to an implementation detail" and a "proper feature that's specified to work" in a language without a specification?

show 2 replies
game_the0rytoday at 2:31 AM

I just realized how little I know about how async event loops.