Skip to content

Instantly share code, notes, and snippets.

@deborasetton
Last active December 14, 2015 15:50
Show Gist options
  • Select an option

  • Save deborasetton/775fb7b53af7d4dbe66d to your computer and use it in GitHub Desktop.

Select an option

Save deborasetton/775fb7b53af7d4dbe66d to your computer and use it in GitHub Desktop.
/**
* Exemplo de paralelismo heterogêneo com microtarefas.
*/
#include <stdio.h>
#include <unistd.h>
task spec task1();
task body task1() {
printf("Running task1\n");
parbegin
printf("Micro-task 1\n");
also
printf("Micro-task 2\n");
parend
}
int main() {
alloc_proc(4);
printf("Calling task1\n");
create 4, task1();
wait_all();
printf("Done!\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment