Skip to content

Instantly share code, notes, and snippets.

@skalarproduktraum
Created February 6, 2011 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skalarproduktraum/813610 to your computer and use it in GitHub Desktop.
Save skalarproduktraum/813610 to your computer and use it in GitHub Desktop.
How easy it is to use GCD
#ifdef USE_GCD
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
#endif
for(FloatType x = xMin; x <= xMax; x += xIntervalStep) {
#ifdef USE_GCD
dispatch_apply((yMax-yMin)/yIntervalStep, queue, ^(size_t yPoint) {
FloatType y = yMin + yPoint*yIntervalStep;
#else
for(FloatType y = yMin; y <= yMax; y += yIntervalStep) {
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment