Question: Write a program in C language to create TWO (2) threads. One thread is a reader thread, it will read a string from the user
Write a program in C language to create TWO (2) threads. One thread is a reader thread, it will read a string from the user input, while the other is a writer thread that will print out the string received from the reader thread. Synchronization is necessary and should be achieved using the pthread_mutex_lock() and pthread_mutex_unlock().
Step by Step Solution
3.47 Rating (157 Votes )
There are 3 Steps involved in it
Below is a simple program in C that creates two threads one for reading a string from the user and a... View full answer
Get step-by-step solutions from verified subject matter experts
