Hi to organize multithreading?

Gor

Client
Регистрация
30.09.2016
Сообщения
248
Благодарностей
30
Баллы
28
Hi!
I have got a task.
There are 10 threads, each of which allocates sublists from the List1 list to another list bound to the List2.txt file. In the List1 list, each thread contains:
1
2
3
4
5
It is necessary to receive in the list List2.txt:
Flow | Figures from List1
1 | 1
1 | 2
1 | 3
1 | 4
1 | 5
2 | 1
2 | 2
2 | 3
2 | 4
2 | 5
3 | 1
3 | 2
3 | 3
3 | 4
3 | 5
...
10 | 4
10 | 5

Column Flow is optional. The main thing is that the numbers 1, 2, 3, 4, 5 do not mix with the numbers of other threads.
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 231
Благодарностей
5 844
Баллы
113
The only thing I can advise is - take lines from main list with deletin, and put back in the end. Thus other threads won't take the same lines.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)