Question
A variable must have a separate value for every thread even though all threads execute the same function. What should be used?
Select an option. Your answer will be checked instantly.
Correct Answer: C. Thread-local storage
Explanation:
Thread-local storage gives each thread its own instance of a logically common variable.
It is useful for per-thread state that should not be shared or locked.
Leave a Reply