My understanding of the background of this question:
- The GIL limits python to one thread running at a time.
- Because of the GIL, multithreading long calculations is not useful
- Threading can still be useful
- Threading may be useful with I/O operations
Therefore my question is:
How would the GIL affect the downloading of a requested webpage? Would making parallel webpage request be a good use of python threading? Because downloading a webpage is an I/O operation, would this mean that threading is useful?
I would imagine that one thread would make a request > another thread would get passed control at some point and make its own request > another thread would get passed control, etc. And then data would start streaming in, but how would this be handled? Would downloads get interrupted? I suppose I am lacking the low-level understanding of response handling by the OS, the python interpreter, and the OS.