/********************************************************************

                    Example 1 (pthreads_HelloWorld.c)

Objective         : To print Hello World using threads.
                    Demonstrates use of:
                    pthread_create()
                    pthread_join()

Input             : None.

Output            : Hello World.


 ********************************************************************/ 

#include<pthread.h>

void           *
printmsg(char *s)
{
	
	
	printf(" %s", s);
	
		return;
	
} 

main(int argc, char *argv[])
{
	
		
		pthread_t thread1, thread2;
	
		
		pthread_create(&thread1, NULL, (void *(*) (void *)) printmsg, (void *) "Hello ");
	
		pthread_create(&thread2, NULL, (void *(*) (void *)) printmsg, (void *) "World!");
	
		
	/*
	 * Join the threads to inform the main thread to wait till they are
	 * done.
		 */ 
		pthread_join(thread1, NULL);
	
		pthread_join(thread2, NULL);
	
		printf("\n");
	
} 
