![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 02.04.2020 03:33 sonyarucker
The program shown uses the Pthreads API. What would be the output from the program at LINE C and LINE P?
#include
#include
#include
int value = 0;
void *runner(void *param); /* the thread */
int main(int argc, char *argv[])
{
pid t pid;
pthread t tid;
pthread attr t attr;
pid = fork();
if (pid == 0) { /* child process */
pthread attr init(&attr);
pthread create(&tid,&attr, runner, NULL);
pthread join(tid, NULL);
printf("CHILD: value = %d",value); /* LINE C */
}
else if (pid > 0) { /* parent process */
wait(NULL);
printf("PARENT: value = %d",value); /* LINE P */
}
}
void *runner(void *param) {
value = 5;
pthread exit(0);
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 00:30
Write the html code to make a link out of the text “all about puppies”. it should link to a pdf called “puppies.pdf” inside the “documents” folder. the pdf should open in a new window.
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 03:50
Q-1 which of the following can exist as cloud-based it resources? a. physical serverb. virtual serverc. software programd. network device
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
You know the right answer?
The program shown uses the Pthreads API. What would be the output from the program at LINE C and LIN...
Questions
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.03.2021 23:50
![question](/tpl/images/cats/mat.png)
Mathematics, 21.03.2021 23:50
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/geografiya.png)
Geography, 21.03.2021 23:50
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.03.2021 23:50
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 21.03.2021 23:50
![question](/tpl/images/cats/mat.png)
Mathematics, 21.03.2021 23:50
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/obshestvoznanie.png)
![question](/tpl/images/cats/health.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 21.03.2021 23:50