Mar 31, 2011
I have been reading up on the parallel programming and even now still a little confused on the whole concepts. Lets say I have a single project with about 5 classes that interact and have local variables in methods and variables accessible to all methods in a single class and even 1 or 2 variables accessible to all classes accessed through instantiation. Now using threads I know that global variables would be overridden by multiple threads if there were no locking applied but local variables to a method/function do not, right?
View 1 Replies
So if I ran the project multiple times meaning as a new process, the methods and variables would be thread safe right and no data corruption occurs? So to implement parallel programming using the task factory, if I created a project that basically creates tasks and each task is basically running an instance of another project, then shouldn't the variables and data be thread safe and safe from corruption? But what if I had the output files and they named by Output & datetime.now.tostring, would there be conflict issues and I ask this knowing that I have seen this happen when trying it. [Code]