Running threads in round robin fashion in java
I am new to Multithreading and synchronization in java. I am trying to achieve a task in which i am given 5 files, each file will be read by one particular thread. Every thread should read one line from file then forward execution to next thread and so on. When all 5 threads read the first line, then again start from thread 1 running line no. 2 of file 1 and so on. Thread ReadThread1 = new Thread(new ReadFile(0)); Thread ReadThread2 = new Thread(new ReadFile(1)); Thread ReadThread3 = new Thread(new ReadFile(2)); Thread ReadThread4 = new Thread(new ReadFile(3)); Thread ReadThread5 = new Thread