apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garrett Rooney <roo...@electricjellyfish.net>
Subject Threads, Locks, Seeks, and Unix
Date Sun, 22 Jan 2006 03:30:52 GMT
I was looking at a patch that was recently posted to fix some behavior
of files opened with APR_FOPEN_XTHREAD under windows.  Out of
curiosity, I decided to see how similar code worked under unix, and
now I'm a bit confused.

The unix file_io code creates a lock in various situations, and then a
fair amount of its code makes use of it to synchronize access to the
file across multiple threads.  It's used in buffer.c, filedup.c,
open.c, pipe.c, and readwrite.c, but it never gets looked at at all in
seek.c, and that seems sketchy.  seek.c is full of places where the
underlying file descriptor has some kind of function called on it, and
then the bookkeeping fields in the file object are updated.  It seems
like those really need to be kept in sync, and to do that with an
XTHREAD file the lock would need to be involved...

Am I out of my mind here, or is this kind of broken?

-garrett

Mime
View raw message