big dog status 2 Posted November 18, 2013 Report Share Posted November 18, 2013 Hi, I have a script that relies on a .csv file to read account data. I am making my first attempt at multithreading and for the life of me, can't figure out how to make my #currentAccountRow, different for each thread. I've been at it for 2.5 hours, I've read just about every multi threading, thread, it seems. I'm sure I'm missing something small but can someone kindly explain to me the logic involved where a script uses one variable to determine which row of a csv it is currently on? When I try it out now, both threads load up and work BUT they are working on the same account. I'm not doing the looping method I'm just manually setting up threads and setting my #currentAccoutnRow differently, within each thread. Quote Link to post Share on other sites
UBotDev 276 Posted November 18, 2013 Report Share Posted November 18, 2013 You need to add your code into a define command and pass #currentAccountRow as parameter. This way when you call define command from thread, each one will get it's own row number. You should also make sure that #currentAccountRow is not getting changed before it get's passed into the define command, for what you may need an additional define command. 1 Quote Link to post Share on other sites
big dog status 2 Posted November 18, 2013 Author Report Share Posted November 18, 2013 Thanks a lot for your help. I actually tried that earlier after reading some threads but I guess I did not do it right, I'll get back to it! Thanks again Quote Link to post Share on other sites
UBotDev 276 Posted November 18, 2013 Report Share Posted November 18, 2013 Can he not dump each colum data to different lists and then run each thread on each different list. This way, each thread is dealing with each column so to speak and won't overlap and overwrite or whatever.I don't think that's needed...threading works OK with tables. By adding data to a new list you would only increase memory usage (duplicated data in memory)... Quote Link to post Share on other sites
big dog status 2 Posted November 18, 2013 Author Report Share Posted November 18, 2013 UBotDev - can I pay you to look over my current script and coach me on what to change for threading? Quote Link to post Share on other sites
UBotDev 276 Posted November 18, 2013 Report Share Posted November 18, 2013 Sending you my PM. 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.