In cPython (the default Python implementation), how often does thread switching happen? This is not a question about using multiple cores; I know about the GIL, and realize that only one thread will be run at at time.
I have seen a few cases where I have two log messages in sequence, and the first log message will be emitted, but the second is not emitted for several seconds. This probably happens because Python decided to switch threads in between the two log statements. This leads me to believe that Python switches between threads once every couple of seconds, which is much slower than I would have expected. Is this correct?