Specific Multithreading Issues
Specific Multithreading Issues
- Subject: Specific Multithreading Issues
- From: Miguel Morales <email@hidden>
- Date: Fri, 4 May 2001 09:43:56 -0700
Hello all, I just joined the list, so I hope this is not a repetitive
question. First, is there any good documentation on multithreading with
foundation? If so where can I find it?
Now on to the specific multithreading question.
I'm developing a very high performance scientific analysis program (I'm
sifting through mountains of real time data looking for Gamma Ray
Bursts), and I'm planning to use distributed objects and threads to get
the most out of small cluster of multiple CPU machines. In my analysis
I will divide the problem up into several identical pieces (each a
separate class instance), each running in it's own thread. Since I have
separate instances all of the instance variables should be fine with
multithreading. What I'm worrying about is temporary variables. Say in
my class I have a method of the following form:
-myMethod
{
int i;
for(i = 0; i<1000; i++)
{
do something with instance variables ...
}
}
How does the compiler handle the variable i? This method will get
called at the same time by multiple threads, but only in the context of
separate instances. If the variable i is associated with the instance
of the class (even though it is not an instance variable per se), I'm
home free. However, if the variable i is associated with the
instruction code then I'll have multithreading issues.
If someone out there is familiar with how the compiler thinks with
regards to temporary variables and can explain my problem, I'd be much
obliged.
Thanks in advance,
-Miguel F. Morales