Answered step by step
Verified Expert Solution
Question
1 Approved Answer
what should i do for the last todo's here : } / / / / / / / / / / / / / /
what should i do for the last todo's here :
TODO:: let detached threads know they need to shut down using the flag you
created in the thread structure. You may only set the flag once here you should
not have more than one flag and it must be in a thread safe manner.
TODO:: Wait for all detached threads to finish without using a busywait loop.
You must wait for the number of threads to change before checking again to avoid
wasting CPU cycles.
HINT: Remember there is a specific object that can Wait for a Condition
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started