- Create a small program, thread_demo, that does the following:
- From thread_demo.c’s main function, create a loop that spawns 5threads with integer arguments 0 through 4.
- The thread’s entry point, in file worker.c, is function voidworker(void *) where void * is expected to be a pointer to an int.The thread computes and prints the square of the argument, thenreturns.
- The main thread should wait until all threads have completed,then print “work complete.”
Be sure to create a makefile. You are expected to use the POSIXthread interface for this assignment. The FAQ has an example ofcreating POSIX threads and waiting for a thread to terminate can
PayPal Gateway not configured
PayPal Gateway not configured