On Wed, 2007-08-22 at 10:35 +0200, Hrvoje Nikšić wrote:
> I think we need a reliable mechanism to prevent file_close messing with
> f_fp while other operations are being performed.  Since each FILE has an
> internal lock associated with it, flockfile could be used to lock out
> the sections that access f_fp (falling back to a mutex in PyFileObject
> on platforms without flockfile) without affecting other threads that
> operate on other FILE's.

Scrap this suggestion, it won't work as written.  flockfile must not be
called after the FILE is deallocated, which is exactly what fclose does.
The mutex would need to be in PyFileObject itself.


_______________________________________________
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

Reply via email to