Jump to content
UBot Underground

Recommended Posts

I'm having a hard time figuring out how to do this.

 

I load a csv file to a table, and loop for each row in the file. I am trying to use threading and in new browser to give each row a unique thread for parallel processing and a unique browser. The problem is the variable I use to keep track of which row I am on is set to 0 outside of the loop at the start. If i put it in the loop, it will keep getting reset. If I put it outside, the threads run at the same time and will run as "0" together.

 

What I need to know, how can I create an incremental variable that works across many threads to keep track of which position the thread is working off. Kind of like a ticket stub at a deli counter.

 

I basically need a thread safe sequence counter.

 

I am incrementing the variable at the end of the thread because that is how I had it before I introduced threads. It worked great till I started monkeying with threads.

Link to post
Share on other sites
  • 2 weeks later...

Care to share? I can't figure threading out.

 

I want to sign up to different wordpress sites. Going single threaded takes a few hours :/

 

I was doing the following:

 

variable counter

loop

code

increment

end loop

 

What I found out, is I need to do

 

variable

function

code

increment variable

 

loop

call function

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