-
-
Save raghav0307/9252fc7b568bc35baab29bdc9da70618 to your computer and use it in GitHub Desktop.
This file contains 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 <abt.h> | |
#include <stdarg.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
ABT_pool pool; | |
void print_hello(void* arg) { | |
printf("Hello!\n"); | |
} | |
void recursive_task(void* arg) { | |
ABT_task childTask1, childTask2; | |
ABT_task_create(pool, print_hello, NULL, &childTask1); | |
ABT_task_create(pool, print_hello, NULL, &childTask2); | |
ABT_task_free(&childTask1); | |
ABT_task_free(&childTask2); | |
} | |
int main(int argc, char *argv[]) { | |
ABT_xstream xstream; | |
ABT_init(argc, argv); | |
ABT_xstream_self(&xstream); | |
ABT_xstream_get_main_pools(xstream, 1, &pool); | |
ABT_task parentTask; | |
ABT_task_create(pool, recursive_task, NULL, &parentTask); | |
ABT_task_free(&parentTask); | |
ABT_finalize(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment