3 ms·
What would be the purpose of yielding control from the thread and tell it to wait, rather than just let it run to completion?
by DNF2 7y ago
What would be the purpose of yielding control from the thread and tell it to wait, rather than just let it run to completion?
- ska 7y agoSometimes you don't know where you want to spend your CPU budget until you have more information.
- DNF2 7y agoMaybe I misunderstand you, but telling the thread to halt is surely a waste of those resources?
- opportune 7y agoBecause sometimes you need to sync the entire program state, or some subset of the state, to make measurements or to let disparate parts of the system interact