Sanjeev 46 Posted March 10, 2013 Report Share Posted March 10, 2013 Hi Guys,I would like to clarify something regarding multi threading -Suppose I am processing items from a list using multi threading - and I am calling the 'next list item' function from within a thread - then is there a chance that two or more threads may end up using the same list item?Say if 2 threads execute in parallel -and call the next list item function for the same list - could they end up using the same llist item?If yes, then how do we prevent this from occuring?Thanks. Quote Link to post Share on other sites
bestmacros 60 Posted March 10, 2013 Report Share Posted March 10, 2013 (edited) you do not use next list item command - loop with global parameter, incrementing it immediately after use. Edited March 10, 2013 by bestmacros Quote Link to post Share on other sites
Sanjeev 46 Posted March 11, 2013 Author Report Share Posted March 11, 2013 you do not use next list item command - loop with global parameter, incrementing it immediately after use.Could you please explain a bit more what you mean? Some code example ? Quote Link to post Share on other sites
bestmacros 60 Posted March 11, 2013 Report Share Posted March 11, 2013 here is logic flow:loop while #pos <= list total (your list with data) get data from file increment #pos make sure pos parameter is global so each thread will "see" it was incremented and will take next pos item Quote Link to post Share on other sites
Security 17 Posted March 15, 2013 Report Share Posted March 15, 2013 This was a very useful thread. Thanks for asking and thanks for answering. 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.