Question: Write and run the program in UNIX/LINUX based C. 1. Write a main program that creates three thread, print their thread id of each thread.
- Write and run the program in UNIX/LINUX based C.
1. Write a main program that creates three thread, print their thread id of each thread. Also print the process id of the main program and prove that the process id of all the three thread are same. (3 marks)
2. Write a program to demonstrate that all threads of the same process share the global data. (3 marks)
3. Write a program to create four threads. Use two datas. First thread must add two datas. Second thread must subtract two datas. Third thread must multiply two datas. Fourth thread must divide two datas. (4 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
