General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Lawrence D’Oliveiro
Tech With Tim
comments
Comments by "Lawrence D’Oliveiro" (@lawrencedoliveiro9104) on "Python Asynchronous Programming - AsyncIO u0026 Async/Await" video.
About talking you are what.
26
12:58 There is a chance that could fail. asyncio only holds weak references to the tasks it creates; it relies on the caller (you) to maintain strong references, to stop those tasks from disappearing randomly. Here it executes after the “task” variable holding the reference has gone.
5
Threading and multiprocessing are preemptive, coroutines are not. Coroutines and threading are default-share-everything, multiprocessing is default-share-nothing. Coroutines are easier to debug than threads.
4
7:35 Worth mentioning at this point the difference between “stackless” and “stackful” coroutines. Python has the “stackless” kind, which is why the await keyword can only be used in the top level of an async-function, not anywhere else.
4
This is not really parallelism. There is only one thread of execution. It simply gives you a way to respond to outside events nondeterministically.
2
I know that feeling. Particularly fun with a sleep call: await asyncio.sleep(«n») vs asyncio.sleep(«n»)
1
Did you know that asyncio is implemented in pure Python? That the whole task-dispatching system works through an interesting (deliberately-designed) interaction between coroutines and generators? I wrote up a description of this in a Jupyter notebook, which I cannot link to here.
1