This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: RFC: Too many race conditions.
On Tue, May 22, 2007 at 09:29:50AM +0100, Andrew Haley wrote:
> David Daney writes:
> > The semantics of files and pipes change if you don't close them when the
> > application asks for them to be closed. In a pipe for example the read
> > side would block waiting for the EOF. For a file, the filesystem
> > containing the file could not be unmounted. Waiting for a potentially
> > blocking I/O operation to finish before closing could cause deadlock.
> Is it true that in such cases the current code would cause incorrect
> operation? That all we would be doing is, at worst, exchanging one
> sort of incorrect behaviour for another?
The current behaviour is correct with the exception of a race
condition between the time it reads the file descriptor field, and the
time it executes accept(). Causing close() to wait would make the
behaviour wrong always.
Cheers,
mark
--
mark@mielke.cc / markm@ncf.ca / markm@nortel.com __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...
http://mark.mielke.cc/