pftg4 102 Posted November 23, 2013 Report Share Posted November 23, 2013 Hi Lilly that won't work either because of the wait the thread count will only max at about 10-11 threads try it yourself set threads to 50 and will only reach 10-11 pftg4 Quote Link to post Share on other sites
MiriamMB 63 Posted November 23, 2013 Report Share Posted November 23, 2013 Hi Lilly that won't work either because of the wait the thread count will only max at about 10-11 threads try it yourself set threads to 50 and will only reach 10-11 pftg4 The script above is a modified version of what the OP submitted to support about threads not closing at the end of the run. We modified it to have the script be more consistent with the way the threads are supposed to work. Removing the 0.2 second wait commands in the thread will open all 50 threads, and after they are closed, but UI still states that one thread is left open. There might be a UI issue in terms of how the threads are being counted as active and how variables are handled in the script, but the purpose of the amended script above is simply to show that threads are indeed closing and threads are working the way they are supposed to. If anyone else wants to go over a script for this issue with us, we'd be happy to take a look at support.ubotstudio.com. Please keep in mind that threading is a complicated process, and it requires careful investigation to figure out the source of any problems that might arise from working with it. Glancing at a video will not help us determine what is going on, but a sample script and lots relevant information will always be very helpful. Quote Link to post Share on other sites
kev123 132 Posted November 23, 2013 Report Share Posted November 23, 2013 hi lilly the issue isn't with threads closing or threads at all the problem is that increments and decrements are getting missed. This seems to be because decrements are getting missed when several threads are decrementing at the same time. Quote Link to post Share on other sites
MiriamMB 63 Posted November 24, 2013 Report Share Posted November 24, 2013 hi lilly the issue isn't with threads closing or threads at all the problem is that increments and decrements are getting missed. This seems to be because decrements are getting missed when several threads are decrementing at the same time. hmm...I did not notice any issues with incrementing or decrementing after the wait commands were added, but we can certainly take another look when possible. I'll let the thread get back on topic. If anyone has any questions about threading, we'll be at support walk through your issues with you. Quote Link to post Share on other sites
kev123 132 Posted November 24, 2013 Report Share Posted November 24, 2013 hmm...I did not notice any issues with incrementing or decrementing after the wait commands were added, but we can certainly take another look when possible. I'll let the thread get back on topic. If anyone has any questions about threading, we'll be at support walk through your issues with you.thanks lilly your delay thou would stop the issue because it would never allow enough threads to run. use ubotdevs original example and you will find the "#THREADS Active" never returns to zero because it misses decrements. to make it really show up change change drop down("Threads", "10,20,30,40,50", #INPUT Threads) to drop down("Threads", "10,20,30,40,50,100,150", #INPUT Threads) and set at 150 Quote Link to post Share on other sites
blumi40 222 Posted November 24, 2013 Report Share Posted November 24, 2013 This one works for mewith 50 Threads perfectwith 100 Threads allmost perfectwith 200 Threads nothere is the code based on the free plugin which u can download herehttp://ul.to/mmba1dojand here the screencapturevideo for all thoese who dont belive.https://www.youtube.com/watch?v=v7_F26crgoQui drop down("COUNT", "100,1000,10000,5000", #Input Count)ui drop down("Threads", "10,20,30,40,50,100,200", #INPUT Threads)ui stat monitor("Threads (Active/Total):", "<b>{#THREADS Active}/{#THREADS Max}</b>")ui stat monitor("COUNT:", #COUNT)set(#COUNT, #Input Count, "Global")set(#THREADS Max, #INPUT Threads, "Global")set(#THREADS Active, 0, "Global")set(#listcounter, 0, "Global")clear list(%mylist)loop while($comparison(#COUNT, ">", 0)) { if($comparison(#THREADS Active, "<", #THREADS Max)) { then { plugin command("Open.Framework.dll", "Thread safe container") { increment(#THREADS Active) } THREAD START() decrement(#COUNT) } else { plugin command("Open.Framework.dll", "Free Ubot Memory") wait(0.2) } }}set(#WAIT Count, 0, "Global")loop while($both($comparison(#THREADS Active, ">", 0), $comparison(#WAIT Count, "<", 10))) { increment(#WAIT Count) wait(2)}if($comparison(#THREADS Active, ">", 0)) { then { alert("Some threads were not closed/decremented properly.") } else { alert("All threads were closed") }}define THREAD START { thread { wait(0.5) plugin command("Open.Framework.dll", "Thread safe container") { decrement(#THREADS Active) increment(#listcounter) add item to list(%mylist, #listcounter, "Delete", "Global") } }} 1 Quote Link to post Share on other sites
UBotDev 276 Posted October 13, 2014 Author Report Share Posted October 13, 2014 Just FYI, with UBot v5.5 release this seems to have been fixed. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.