Skip to content

Instantly share code, notes, and snippets.

@c16a
Last active June 25, 2018 17:57
Show Gist options
  • Save c16a/e1ac031b0afe9b6c1c73fe72fde407f1 to your computer and use it in GitHub Desktop.
Save c16a/e1ac031b0afe9b6c1c73fe72fde407f1 to your computer and use it in GitHub Desktop.
Parallel threading in good-old C
#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