Last active
June 25, 2018 17:57
-
-
Save c16a/e1ac031b0afe9b6c1c73fe72fde407f1 to your computer and use it in GitHub Desktop.
Parallel threading in good-old C
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <pthread.h> | |
void *threadFunc(void *vargp) | |
{ | |
printf("Printing GeeksQuiz from Thread \n"); | |
return NULL; | |
} | |
int main() | |
{ | |
pthread_t thread_id; | |
printf("Before Thread\n"); | |
pthread_create(&thread_id, NULL, myThreadFun, NULL); | |
pthread_join(thread_id, NULL); | |
printf("After Thread\n"); | |
exit(0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment