3) Given the following code - what will the output be?
Hint: this is a trick question. Yes, really.
Hint 2: The answer isn't technically the same numbers twice
Hint 3: The answer is an explanation of what will happen - 4pt
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
void *print message function (void *ptr)
{
int i;
for(i = 0; i < 6; i++)
printf("%i\n", i * 2);
}
int main()
{
pthread_t thread1, thread2;
int iret1, iret2;
iret1 = pthread_create(&thread1, NULL, print message function, NULL);
iret2 = pthread_create(&thread2, NULL, print message function, NULL);
pthread_join(thread1, NULL);
pthread_join(thread2, NULL);
return 0;
}