RFC: Too many race conditions.

Andrew Haley aph-gcc@littlepinkcloud.COM
Tue May 22 08:30:00 GMT 2007


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?
  
 > Also counting references requires obtaining some type of mutual 
 > exclusion lock twice for each I/O operation.

Atomic counters are easy enough to do.

Andrew.



More information about the Java mailing list