How do I make the subsequent threads pause when using global vars

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
I have c# setup using global variable on a counter to take line form subsequent lines of an accounts file.

It works when i run the poster on one thread, then manually add another thread after a certain time.

But when I setup 2 threads to run right away for some reason it takes the same data form line zero each time and ignores the wait funciton i have in place in the template.

I set it up so that there is a logic check for whether the global var is initilised or not. If not then no wait but if initialized then it should wait 5 seconds before starting. But it doesnt do that and runs both threads exactly in sequence.

Why might it be doing this? I want a pause before running each thread so that it will only start the next one once the lines have been taken/written for the first.

I want ot have it so that if i have ten accounts in my accounts file i can just put 10 into execution count and itll use only that one template to run the 10 threads with different accounts.
 

rostonix

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

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
It still doesnt work. I put pauses all over the place including an incremental pause which is 3 seocnd + count of global var but still it pulls the same line more than once. Why is this?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
You have error somewhere. Dont try to add logic from my example to your own logic. Build your logic from my example.
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
The errors happened when only using your one which is why i added things and still the same problem. It was still taking from the same line with only your steps.

Im just wanting to take line from table of account details then move to next line etc etc.
 

rostonix

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

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
If you use my example, do you use global or local variables in table/list actions?

Why you even need to use global vars in this case? Why not to take them with deleting (and putting to the end if needed)
Awesome! I had been using global vars for the list but after reading your last sentecne I tried the local var and it works now. So thanks :-)

Yes I had been doing your second sggestion but bad end most times didn't write the files back to the file since I had to shut down the post or delete the project so I was always having to manually go back and delete the accounts file and copy it.

One more thing...is there a way to reset the global vars to 0 without having to restart zenno. Cos often there is an error in the project or one thread may fail and I have other projects running but then I have to shuit the whole poster down to reset the global counter to zero. Can it somehow be done manually wihtout restarting the whole program?

Likewise is there a way to allow retries on failed threads within the multithread template without having to restart all threads? I havent tried yet since i didnt even have the multithread working properly so didnt wanna get ahead of myself.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 715
Баллы
113
You overcomplicate things.
Yes you can set value of glabal variable to 0 but that should be done within you project (maybe with bad end and additional logic there)
 
  • Спасибо
Реакции: Harambulus

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Its because i dont understand these global vars properly and they confuse me. how woud i program it into to decrease by one? Same way as with set variables and decrease counter or different? When i tried using set variables it says that thread active is not initialised but all variables the global variable is active and set at 2?

Ok I looked in the C# code and copied and changed from +1 to -1 and seemed to work in debug :P
 

Harambulus

Client
Регистрация
16.09.2011
Сообщения
365
Благодарностей
10
Баллы
18
Can you tell me the code please to destroy the global variable. Because i want to make a seperate template to do that so i dont have to keep resetting zp when i want to restart the threads as i have other templatess running too which have to close also.

I tried doing it using set variables and resetting the global to 0 but it didnt work since intiitalise is the first step in the sequence of the original tmepalte so id still get one thread failing due to that.

I also tried doing a logic check instead in original template saying if global exists do not initialise but still got an error for some reason. I see now this i not viable cos it interrupts the otehr increase in increments after initialisation.

So how to clear it completely rather than just set to 0?
 
Последнее редактирование:

rostonix

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

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