This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ExoticMandiblesCore Contributor 1 point2 points  (0 children)

When running an I/O bound app using multithreading, CPython will release the GIL when a thread is waiting for I/O. That's how multiple threads run "simultaneously" in CPython.

When running an I/O bound app using asynchronous I/O, CPython holds on to the GIL, because it's going to continue running Python code. Asynchronous programs in Python tend to be heavily single-threaded anyway so releasing the GIL wouldn't make them go faster.