Skip to content

Instantly share code, notes, and snippets.

@raghav0307
Created October 7, 2021 18:18
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 raghav0307/9252fc7b568bc35baab29bdc9da70618 to your computer and use it in GitHub Desktop.
Save raghav0307/9252fc7b568bc35baab29bdc9da70618 to your computer and use it in GitHub Desktop.
#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