Whats wrong with this code (thread stuff)?

Jack77

Новичок
Регистрация
25.10.2016
Сообщения
25
Благодарностей
3
Баллы
3
Hello guys. I'm trying to lock a thread in order to each one has its own ID. To tell the truth, now I just need to know who is executed first, because the first one will do the initial stuff (copy lists and other things).

So, don't know why but anyway the code get lost and I get repeated IDs for different threads.

I didn't want to create the global in real time to check it (try, catch). That's really annoying to debug in project maker (have to delete by hand the global variable to debug in PM).

By the way, are there any way to debug this? I have Visual Studio anyway.

Thank you guys!

Sem título.png



log.png
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 413
Благодарностей
5 900
Баллы
113
It may be that previous threads already finished and your counter dropped to first value.
 

Jack77

Новичок
Регистрация
25.10.2016
Сообщения
25
Благодарностей
3
Баллы
3
So Vladz, I have set 10 threads. The software has initiated6 of them and later the other 4. But I do have set 10 at the beginning.

The problem is that the global variable loses its value in the middle of execution. Its 0 (it is incremented) at the beginning and them from nowhere its go back to the default value. I've made many thing to solve my case.

At end I've create a pid file to substitute the global variable.

It's perfectly working right now with the pid file. I know the software won't change by itself the pid file like it do with globals. I didn't hope that global variables were so unstable. That's really awful.

I'm a software engineer. For me, once you start the execution, the global variable should remains with its value at least until the end of execution. The way it is now I can't trust global values.

I'd read some complains about it in the forum and now I discover the strange behavior :(

So, I have so much respect to the software and to you guys. Congratulations for the amazing software, really. I bought UBot Studio professional before and them ask my money back to buy Zenno. But that bug is really annoying. I've find a way to deal with it, but life would be much easier if global variables had a constant behavior
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 413
Благодарностей
5 900
Баллы
113
I couldn't reproduce the problem. Global variable works fine.
Глобальная_потоки.png
 

Jack77

Новичок
Регистрация
25.10.2016
Сообщения
25
Благодарностей
3
Баллы
3
Hi there VlaZ.

How many bases have you used VladZ?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 413
Благодарностей
5 900
Баллы
113

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