title: Access File through multiple threads
body: <p>I want to access a large file (file size may vary from 30 MB to 1 GB) through 10 threads and then process each line in the file and write them to another file through 10 threads. If I use only one thread to access the IO, the other threads are blocked. The processing takes some time almost equivalent to reading a line of code from file system. There is one more constraint, the data in the output file should be in the same order as that of the input file.</p>
  
  <p>I want your thoughts on the design of this system. Is there any existing API to support concurrent access to files? </p>
  
  <p>Also writing to same file may lead to deadlock. </p>
  
  <p>Please suggest how to achieve this if I am concerned with time constraint.</p>