It seems when I google what I\O is, I get hits that show it stands for "Input" and "Output". I see blogs on Python titled, "Python File I\O --Part 19, Advanced File Input and Output " If I go to the Python docs and search for input/output: https://docs.python.org/3/tutorial/inputoutput.html The examples are limited to print statements and reading/writing files.
I see no examples of web-services or networking as Input/Output in the "Input and Output" section of the Python docs, despite seeing the term I/O used often with these concepts. Is I/O containing the same meaning when referring to web-services and networks as well?
I've been doing a lot of reading on the GIL and multi-threading recently and
the term I/O bound
has popped up in addition to I/O
.
I/O bound seems to refer to a state where there is a lot of CPU idleness, due to the slowness of getting data to the CPU. Multi-threading seems to be used often with Webservices and Networking because I'm assuming there is a lot of CPU idleness, i.e I/O bound heavy tasks because you are always for waiting a user-input to act upon.
Now are the print
statements as well read/write files also considered I/O bound tasks?
Finally, the term I/O
has also popped up in the Python Docs regarding GIL:
"The GIL is controversial because it prevents multithreaded CPython programs from taking full advantage of multiprocessor systems in certain situations. Note that potentially blocking or long-running operations,, such as I/O image processing, and NumPy number crunching, happen outside the GIL. Therefore it is only in multithreaded programs that spend a lot of time inside the GIL, interpreting CPython bytecode, that the GIL becomes a bottleneck."
So the reference to I/O in this text, says that all I/O tasks bypass the GIL --
so does that mean print, reading and write to files, webservices, networking
etc -- all these types of tasks bypass the GIL and are can be exploited by multithreading?
Thank you.