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) : 5 60 Calculate Irr Three Cash Flow Diagrams Follow Use Eoy Zero Eoy Four Ii Ii Reference Q32456258 . . . .(Solved) : 5 60 Calculate Irr Three Cash Flow Diagrams Follow Use Eoy Zero Eoy Four Ii Ii Reference Q32456258 . . . .

<br/><img src="https://media.cheggcdn.com/media%2Fc30%2Fc309673a-5653-470b-b7de-81774deca6aa%2Fimage.png" alt="5-60. a. Calculate the IRR for each of the three cash-flow diagrams that follow Use EOY zero for (i) and EOY four for (ii) and (ii) as the