Anonym 53 Posted February 1, 2012 Report Share Posted February 1, 2012 I am doing a test script for my client. The four web fronts seem to generate canonicals in an intermittent/strange way. I need to see if this can be caused by stress, load or just because. Therefor I need to run several threads towards the server(s). When I am generating the stats I have a table and in this table I increase a variable for each new occasion where I test the server for the canonicals (whether canonicals are present or not in the generated web page), this explicitly means for each time a thread reads a page. When everything is ready, the idea is to save the table(s) into files that are partially identified by a thread ID (so there will be no conflict when accessing the file).Well, the output in those files sucks and I just came to think of how variables are handled between threads. I mean, a thread is a thread and not a process, huh!? So there is no process context that is unique to the thread or does the thread have its own set of variables, in my case e.g. the table. I mean let's say I have my row counter that I increment, I call it #rowOffset , every time I increment that in one thread, does that mean that another thread will see the incremented value or not? Will the table be accessible between threads? If so, is there some sort of synchronization functionality so that resources used by several threads are not messed up? Quote Link to post Share on other sites
JohnB 255 Posted February 1, 2012 Report Share Posted February 1, 2012 You change the scope of the variable from Global to Local in the advanced dropdown while editing. John Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted February 1, 2012 Report Share Posted February 1, 2012 also keep in mind that variables when global are set globally overwriting any previous set value. When using them locally they are locally defined, and stored. So in fact they are not local to a thread but local to a defined command. create a defined command, and place your local variables in them, then call the defined command in the thread. Quote Link to post Share on other sites
Anonym 53 Posted February 1, 2012 Author Report Share Posted February 1, 2012 Thanks a lot! 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.