Here's how I understand it (please correct me if I'm wrong): Python switches between Threads in certain time intervals. Additionally when waiting for an I/O Operation Python releases the GIL so that another thread can be processed.
Here's what I don't understand:
- How is the time interval for switching between Threads determined?
- How does Python know that a thread is waiting for an I/O Operation? (Some libraries like requests do not work with asyncio but when using threading, Python somehow knows when they're waiting for I/O)
- If Python can somehow by itself determine if it is waiting for I/O, why would someone ever use asyncio?