Created
October 9, 2009 01:07
-
-
Save tobiastom/205596 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <dispatch/dispatch.h> | |
int main(void) { | |
dispatch_queue_t the_queue = dispatch_get_concurrent_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT); | |
size_t iterations = 100; | |
dispatch_apply(iterations, the_queue, ^(size_t idx) { | |
sleep(rand()%10); | |
printf("%zu\n", idx); | |
}); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment