views:

177

answers:

2

I saw some handwarmer apps and I guess it's very easy to make something like that by running multiple processes at once. Has anyone had a go on it? If you did, can you share it with us here?

Thanks

A: 

You can easily spawn several threads:

- (void) reticulateSplines {
    while (1) ;
}

- (void) spawnThreads {
    for (int i=0; i<kNumberOfThreads; i++)
        [self performSelectorInBackground:@selector(reticulateSplines)
              withObject:nil];
}

That’s not several processes and probably does not warm the machine up, though.

zoul
+1  A: 

Just find some endlessly repeating calculation (like something that finds the digits in Pi for example), and launch three or four threads performing them - either an NSOperationQueue with a concurrent count set to four, or just spawn off threads yourself.

The key is to make the system work in some way, you can either exercise the CPU or the GPU (or both).

Kendall Helmstetter Gelner