logo

Crowdly

What will be printed by the following code snippet that creates two (2) threads ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What will be printed by the following code snippet that creates two (2) threads to execute the function mythread and joins them to ensure they both finish?

void *mythread(void *arg) {

int result = 0;

result = result + 100;

printf("result %d\n", result);

}

thread_t p1, p2;

thread_create(&p1, mythread, NULL);

thread_create(&p2, mythread, NULL);

thread_join(p1);

thread_join(p2);

More questions like this

Want instant access to all verified answers on moodle31.upei.ca?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!