> That sounds like a horrible idea. The GIL should never be held during an
> I/O operation.

For a greenfield design, I agree that it would be perverse.  But I thought we 
were talking about affordances for transitions from code that was written 
without consideration of multiple interpreters.  In those cases, the GIL can be 
a way of saying "OK, this is the part where I haven't thought things through 
yet."  Using a more fine-grained lock would be better, but would take a lot 
more work and be more error-prone.

For a legacy system, I'm seen plenty of situations where a blunt (but simple) 
hammer like "Grab the GIL" would still be a huge improvement from the status 
quo.  And those situations tend to occur with the sort of clients where 
"Brutally inefficient, but it does work because the fragile parts are 
guaranteed by an external tool" is the right tradeoff.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/AAWSCUNVS2NUXRHVATO736KM6I5M6RK5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to