On Fri, May 11, 2007 at 10:38:01PM -0300, Davi Arnaut wrote: > The patches improves the locking interaction with buffering. But, quite > frankly, the unix file_io locking and buffering is a bit messed. There > is no clear indication which functions are protected by APR_XTHREAD, > checks for partial writes on flushing are missing, buffering and file > positioning don't play well together, et cetera.
I don't disagree that the existing buffering/mutex stuff is a mess, but nested mutexes are not available on all platforms, so they can't be relied upon. > I am in the middle of writing a patch that converts all file_io to > standard i/o functions (stdio/streams) so we can remove all code > involving buffering, file positioning and even locking at some cases. It > saves a huge amount of code lines, and I hope, gives fewer bugs. A notable Unix platform has a crippled stdio implementation (32-bit Solaris), so this probably doesn't really fly either. joe
