• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Specific Multithreading Issues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Specific Multithreading Issues
      • From: "Dennis C. De Mars" <email@hidden>
  • Prev by Date: Re: Opening old Mac files without filename extensions
  • Next by Date: Re: searching info, doc, examples for OS X cocoa app
  • Previous by thread: Re: Opening old Mac files without filename extensions
  • Next by thread: Re: Specific Multithreading Issues
  • Index(es):
    • Date
    • Thread