java io read and write lock
<p>suppose I have a file that might gets written by one thread/process Writer and read by another thread/process Reader.
Writer updates the file every x time interval, and Reader reads it every y time interval, 
if they happen to read and write to the file at the same time, will there be any issues? would the read block until writes finishes?  or would the read fails?  and vice versa?
What's the best practice here?</p>
