Jump to content
UBot Underground

[FREE PLUGIN] Threads Counter - UBot v4 Threading Fixed


Recommended Posts

Okay i changed it to use the thread counter read instead of by variable and its still miscounting. I changed my thread code to be exactly like your example as well with the only difference being my define command. the thread counts are all outside of my define so nothing within the define code should be messing up the thread counter....

Please share the code where we can reproduce that problem. Then we are able to help you.

 

Kindest regards

Dan

Link to post
Share on other sites
  • Replies 160
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

As you may be aware threading in UBot v4 is not safe and may not work as expect under certain conditions, which would result in threads slowly dying out, so at the end, you only get left with 1 active

Awesome plugin UBotDev

You are not using the plugin from the title, instead you are using the plugin that Blumi 40 keeps posting here (Blumi40, can you please open another thread for that plugin instead of discussing it her

http://i.imgur.com/yZJckir.png

 

its not thread safe. 

 

The plugin works fine. Your code might be the problem.

But as mentioned a couple of times, without showing us your code, we can't help you.

Give us some Ubot code that allows us to reproduce the error please. Without code, there is nothing we can discuss.  :blink:

 

 

Dan

Link to post
Share on other sites

im using the exact same code in the demo here. the problem is the DECREMENTING thread count. it really doesnt seem to be thread safe. I dont want to share my full source for obvious reasons, but what i can say is.. im 100% using the exact demo in this thread and im not new to ubot ive been doing this a long time. unless defines sometimes randomly get skipped, there is no reason for the thread count to be off other than it not being thread safe and decrementing ' at the same time' which is throwing off the count. 

Link to post
Share on other sites

No one else except you is having this problem or is being able to reproduce it. While you can't share your code we also can't help you "because of the obvious reasons"

 

You've been doing UBot for long time.....but you made the most basic mistake with threading, while you didn't use a define command around thread. With such a basic mistake I think you still have some problems understanding threading in UBot, that's why I think the problem is actually in your code and not with the plugin; If you would read the post about how threads counter does it's job and understand the C# code behind, you would know that it is indeed thread safe...I guess there could be a small chance that UBot would make in unsafe (via their plugin API), but I doubt that's the case (again, never had problems with the plugin).

 

P.S.: To solve this....maybe try your code in Ubot v5, where you don't need threads counter anymore, since threading seems to be fixed there (although I've decided to still use threads counter in v5 until it becomes more stable, so I can revert to v4 any time).

Link to post
Share on other sites
  • 1 month later...

UbotDev, as discussed in PM, I was wondering if it were possible to have multiple counters. I use the thread counter mainly for list positions as it increments and sets the list position in one shot to avoid conflicts. However, I'd like to run multiple tasks at one time that both use the threads counter, so it would be great if it were possible to have multiple counters. Thanks

  • Like 1
Link to post
Share on other sites
  • 2 months later...
  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...