Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Yes indeed. We could use an RLock to avoid the problem but RLock's are
damn slow since they are written in pure Python (see #3001). Rewriting
the critical parts of RLock (constructor, acquire(), release(),
__enter__(), __exit__()) in C should not be too complicated, would you
want to do it? :)

> Solution: use C implementation of Lib/io.py (from Python 2.6) to avoid 
> ceval hook?

I guess it's out of question. However, Buffered{Reader,Writer,Random}
should be rewritten in C one day, it is necessary for speed. Then the
problem will vanish since a lock will only need to be taken when
releasing the GIL, that is not when Python code is being interpreted.

----------
nosy: +pitrou
priority:  -> high

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to