On 3/14/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
Don't forget that sys.setcheckinterval() is more of a hint than a requirement. It's easy to wrap sys.setcheckinterval () in a try/except or an if-hasattr, and just ignore the case where it doesn't exist ('it won't be necessary'). Doing the same thing with a 'critical section' would be a lot harder. I would also assume a 'critical section' should not allow threads in extension modules, even if they explicitly allow threads. That's quite a bit different from making the check-interval infinitely high for the duration of the block.
Once place where we already have CPython specific support is in
sys.setcheckinterval(). That suggests adapting that function or adding a new
one to temporarily stop switching, almost the same as
sys.setcheckinterval (sys.maxint) but continuing to perform other periodic checks
for control-break and such.
Don't forget that sys.setcheckinterval() is more of a hint than a requirement. It's easy to wrap sys.setcheckinterval () in a try/except or an if-hasattr, and just ignore the case where it doesn't exist ('it won't be necessary'). Doing the same thing with a 'critical section' would be a lot harder. I would also assume a 'critical section' should not allow threads in extension modules, even if they explicitly allow threads. That's quite a bit different from making the check-interval infinitely high for the duration of the block.
--
Thomas Wouters <[EMAIL PROTECTED]>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com