useful). • One task must finish execution before the other can start. • Tasks are dependent. • Used for pretty much anything; OG. • Non-blocking. • One task can start execution before the other is finished. • Tasks are independent. • Suitable for I/O, networking...etc.
A machine with single CPU and a single thread can still execute tasks asynchronously (seemingly in parallel). However, it’s unusual to find async tasks running on the same thread.
• Number of sockets. • Synchronization is hard to achieve. • Race conditions. • Unpredictable scheduling. • Deadlock. • Resource starvation. “Threads are the `goto` of our generation” - Someone
event-loop. Collection of tools for other frameworks to use; no http implementation, no database drivers...etc. Interfaces, factories, futures, tasks, subprocess. Simple and easy to learn. Really tho!
loop.run_forever() and loop.run_until_complete() • asyncio.wait() and asyncio.gather() • loop.run_in_executor() • loop.close() • asyncio.set_debug() Unless you’re building a framework