![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)
Other questions on the subject: Computers and Technology
![image](/tpl/images/cats/informatica.png)
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 15:30, 1232444553
Which of the following examples has four beats in each measure?
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
![image](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 06:20, kiarakagni
What is a point-in-time measurement of system performance?
Answers: 3
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 in other subjects:
![Konu](/tpl/images/cats/en.png)
English, 22.10.2020 23:01
![Konu](/tpl/images/cats/mat.png)
Mathematics, 22.10.2020 23:01
![Konu](/tpl/images/cats/biologiya.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 22.10.2020 23:01
![Konu](/tpl/images/cats/mat.png)
Mathematics, 22.10.2020 23:01
![Konu](/tpl/images/cats/istoriya.png)
History, 22.10.2020 23:01
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/biologiya.png)
Biology, 22.10.2020 23:01
![Konu](/tpl/images/cats/mat.png)
![Konu](/tpl/images/cats/mat.png)
Mathematics, 22.10.2020 23:01