anI used a C++ framework, where yield at the end of every loop cycle was mandatory. Now that I'm starting with C# and C++/CLI, I came across the yield function as well. I'm creating an event loop and was wondering if the use of yield is necessary. I'm not creating a game, where frame rate is important, I'm going for maximum performance (speed).
function main
{
initialize
loop(!quit){
update input
update application
render
yield
}
terminate
}
Isn't a platform capable of dividing the running time properly between different applications and should I use yield because of that?
If yes, for how long should I do this and isn't it better to use thread sleep, so threads with lower priority get some extra time as well?
Answers about other languages the .NET are also appreciated. I'm just curious if the general purpose of yield is really necessary.
Thanks