Sanfoor Sanfoor

Sanfoor Sanfoor

  • NA
  • 6
  • 12.1k

Create thread pool to read multiple files in parallel

Dec 5 2015 2:11 PM
i need to create a thread pool, from which i can read up to 10 files at a time in parallel.
and for each thread reads a file it must  insert into another shared text file its id and some text ( for example "thread 1 reads file x").
i need to implement a locking mechanism on this shared file that ensures that only one thread may writes on it at a time, but multiple threads 
may read data from the shared file simultaneously. 
 
really i am new to threading programming, and i am confused about how to start.
waiting your help please :)

Answers (1)