Skip to content

Instantly share code, notes, and snippets.

@raghav0307
Created Oct 7, 2021
Embed
What would you like to do?
#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