Question

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?

Was it helpful?

Solution

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).

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top