Multithreading question

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
I have a template that creates accounts and places them in a text file

then I have a second template that uses thos accounts....



When I use the second template I like to do multithreading.... But I think I'm doing something wrong


to avoid using the same account twice by multiple threads, I first do a random pause of 1 to 20 seconds.... then I read the file and delete it, then take the first line in memory and immediately save the file again......

But when I create a lot of threads, (more than 10) ... sometimes it happens that my accounts.txt file dissapears and does not come back....

Any tips is appreciated or should I take a different approach?

Thank you,
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Just put a path to file in lists' settings and check "save changes" multithreading will work this way.
 

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
Really ?

Does this also automatically save when I re-add an account at the bottom of the list (because it failed to login for example)?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
Sure.

This option in list or table settings allow each thread to use 1 common copy of a file and make changes to it.
 
  • Спасибо
Реакции: neutralhatter

neutralhatter

Client
Регистрация
17.08.2012
Сообщения
100
Благодарностей
6
Баллы
18
cool. Will update my template. thanks for the tip.
 

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