Last active
December 14, 2015 15:50
-
-
Save deborasetton/775fb7b53af7d4dbe66d 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
| /** | |
| * 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