Jump to content
UBot Underground

Threading local/global variable question


Recommended Posts

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.

Link to post
Share on other sites

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.

  • Like 1
Link to post
Share on other sites

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)...

Link to post
Share on other sites

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...