Please help - Running with csv multithreads

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
a project that have a csv.
example

the project run with delete line from csv, than go to subproject and read a 10 cells on csv.

if i run 5 threads on this project, so do they go in order or do they conflict?

i don t want see that the first thread it's ok but the second no because the 3° delete line from csv and so the second thread read a 3°line and no the second
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113
Hi. You can run mutithreads on one file without problems.
When one thread works with file, it locks it down and after finished its unlocked for other threads.
So no worries.

Cheers
 

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
but i have the comand read cell in subproject and other subproject in the project no at the same time, so other threads can run when the project do other things and when it go to csv will read other lines because other threads have changed the csv
 
Последнее редактирование:

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113
Basically in short threads are not numbered and You can not control how to start them across different projects.
I'm not very sure what is Your logic, but if I understand then You take one line from .csv and then take another 10 lines from same csv ? Then why not take 11 lines from .csv at once ? Then You make sure lines are taken in order.
 

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
Every project have a proxy, so every time i run 1 project, the first thing is delete first line in csv, so go to some subproject (each subpj have at the first a lot of read cells). i need to make a file-copy for each tread?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113
Every project have a proxy, so every time i run 1 project, the first thing is delete first line in csv, so go to some subproject (each subpj have at the first a lot of read cells). i need to make a file-copy for each tread?
Not sure what proxy have to do with removing lines from file.
No You do not need to make file copies, You just have to think about correct logic for Your bots.

Like I said before. If this is one file and one main projects + many subprojects then make all logic where working with file in Your main project, and give all lines what is needed for subproject over variables.
 

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
ok but in this case they will be in conflict?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
If i don't order the project, some thread read other lines
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113

Moneyitaly

Пользователь
Регистрация
28.03.2018
Сообщения
56
Благодарностей
1
Баллы
8
but locks it down for all time of project (also when go to site or other) or only when work/read the file?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113
but locks it down for all time of project (also when go to site or other) or only when work/read the file?
Not sure I understand what is Your problem exactly.
Are you just discussing or You have real problem with managing files ?

Basically two different threads from two projects will not get same first line from file, that's what I'm trying to tell You.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113
Another point.
When using Your files. Use Bind to file method.
Please search forum if You want clarification what Bind to file means.

Thanks
 

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