Creating cooperating threads. In this assignment you'll be using threads to do our cow distribution (similar to the shm hw). Make a struct that holds number of cows and an identifier. Create a global variable of this new struct type. Let's call this variable "cow_stable". Initialize cow_stable to something appropriate. If you follow the recommendations throughout this assignment, you can initialize the id to 7. You must initialize the number of cows to the value of the first command line argument before spawning threads. If there is no first command line argument, report an error. If the integer value is not more than 40, report an error. Use the command line arguments version of main. Typically these parameters are named argc (for count of arguments) and argv (for vector of arguments). In this project you should make sure argc is big enough. Then you should use atoi to convert from char * to integer from argv[1]. Inside main, spawn 8 threads. When creating the threads, pass in a unique id for that thread as an integer. I recommend using 0 through 7. Each thread will also need to know the "previous" id. For 0, that should be 7. For the others, it should be the id that is 1 less. The main thread should wait for all other threads to finish before exiting the program. You might find it useful for the main thread to constantly report the values in cow_stable while debugging. You can also have your threads do some output to assist in this process. A thread should wait until the id in cow_stable becomes the id that is previous to it. So the thread with id 0, will wait until the id becomes 7. When the id becomes 7, the thread will decrease the cows in cow_stable by 1 and then change the id to its own id number (in this case to 0). The thread should then sleep for 1 second. A thread must do this 5 times. After a thread has taken 5 cows, it should output a report to the console and then quit.