Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 4075be93 authored by ANDRADE-BARROSO Guillermo's avatar ANDRADE-BARROSO Guillermo
Browse files

Merge branch 'master' of gitlab.inria.fr:sed-rennes/formations/tutorials_parallel_computing

parents acf958ff 9efd9afc
Branches
No related tags found
No related merge requests found
File added
/*
* hello.c - Pthreads "hello, world" program
*/
#include <pthread.h>
#include <iostream>
void *thread(void *vargp);
int main()
{
pthread_t tid;
std::cout << "Hello World from the main thread!" << std::endl;
pthread_create(&tid, NULL, thread, NULL);
pthread_join(tid, NULL);
pthread_exit((void *)NULL);
}
void *thread(void *vargp) /* thread routine */
{
std::cout << "Hello World from a thread created by the main thread!" << std::endl;
pthread_exit((void *)NULL);
return NULL;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment