subject

Read the man page of the following functions pthread_create, pthread_join. Read the man page of the following functions pthread_mutex_init, pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_unlock, pthread_mutex_destroy. For each task, fullfill the requirements provided in the comments, or fill the blank. Compile the code and make sure it is executable. What is the output of the code? #include
#include
#include
void *functionc ();
pthread mutex t mutex1 PTHREAD MUTEX INITIALIZER
int counter = 0 ;
main ()
int rc1, rc2
pthread_t thread1, thread2;
* Create independent threads each of which will execute functionC*/
if ((rc1-pthread_create (&thread1, NULL,
printf ( "Thread creation failed : %d\n", rc1 ) ; , NULL))) if (( rc2-pthread_create (&thread2, NULL, , NULL)))
printf ( "Thread creation failed : %d\n" , rc2 ) ;
pthread_join ( pthread_join ( return (0); NULL) , NULL);
void *functionc () (
pthread_mutex_lock (
counter++
printf ( "Counter value : %d\n" , counter) ;
pthread mutex_unlock
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:20
This os integrated the processing power of windows nt with the easy-to-use gui of windows 98. windows 2000 windows 3.11 windows for workgroups windowa millennium edition
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
question
Computers and Technology, 23.06.2019 18:40
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
Me if you do then you get 10 points and brainliest
Answers: 1
You know the right answer?
Read the man page of the following functions pthread_create, pthread_join. Read the man page of the...
Questions
question
Mathematics, 22.09.2020 14:01
question
Mathematics, 22.09.2020 14:01