- Регистрация
- 30.03.2018
- Сообщения
- 6
- Благодарностей
- 0
- Баллы
- 1
I have a file from which I take lines using the counter variable. The problem however is that even though I'm increasing the counter with +1 each time, all the threads work from the start of the file and do it as many times as there are threads.
For example, if I am using 10 threads, each line is being done 10 times. What can I do to avoid this and make threads work in a sync?
For example, if I am using 10 threads, each line is being done 10 times. What can I do to avoid this and make threads work in a sync?