Course Solutions Uncategorized (Solved) : Consider Following Code Include Include Include Void Myfunction Void Param Int Main Int Pt Q30486073 . . . .

(Solved) : Consider Following Code Include Include Include Void Myfunction Void Param Int Main Int Pt Q30486073 . . . .

 

Consider the following code:
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>

void *my_function(void *param);
int main()
{

int i;

pthread_t tid;

pid_t pid;

for(i=0; i<3; i++) {

pid = fork();
pthread_create(&tid,NULL,my_function,NULL);

pthread_join(tid,NULL);

}

}

a. Explain what is happening within the for-loop.  Your ex- planation must explain the
purpose and effect of the three system calls.

b. Including the initial parent process, how many processes arecreated.    (To answer this
question do not supply just the number of processes—explain yourreasoning).
Note: the answer is not 4.

c. How many unique threads are created? (To answer this ques- tiondo not supply just the number
of threads—explain your reasoning. Also remember, the initialprocess is thread 1).

Expert Answer


An answer will be send to you shortly.

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : Its62904 Database Systems Swer Question 1 0 Ii Based Figure 1 2 Hr Schema Employee Table N Q29950513 . . . .(Solved) : Its62904 Database Systems Swer Question 1 0 Ii Based Figure 1 2 Hr Schema Employee Table N Q29950513 . . . .

Please tell me the answer quickly.<br/>Use MySQLworkbench thanks.<br/><img src="https://media.cheggcdn.com/media%2Fd41%2Fd4166254-3518-4458-9c16-f7117b66a659%2Fimage" alt="ITS62904- Database Systems swer Question 1 (0) and (ii) based on Figure 1, and 2 Hr schema (Employee table) note: Salary