You should complile with -lpthread, such as
gcc -o thread thread.c -lpthread
thread.c Inverstigate the code and give command “thread mesaj”. Try without any mesaj, just as “thread”, What “NULL” corresponds for.
thread1.c Execute several times, and check the change in thread_id, if there is not, why?
thread2.c Study the code and describe the functionality.
thread3.c Study the code and describe the functionality.
thread4.c Study the code and describe the functionality. Try to write the without struct.
pipe.c Describe how pipe() system call works.
pipe1.c read_pipe.c Compile both programs and execute as “pipe1 10”, execute several times by changing the seed each time
signal.c Study the code and describe the functionality.
signal1.c Study the code and describe the functionality. Break with Ctrl+Z, you will get
[1]+ Stopped signal1
then kill the stopped process with “kill %1”.
After each iteration the thread sleeps for a short while.
Compare the programs.
Test your program several times.
Do you always get a correct result?