Originally posted by indepe
View Post
On Windows however it seems that the scheduler always (or at least more frequently) simply switches threads when sched_yield() is called and as Linus wrote to the dev that also only happened since the game was the only app on the system, run a few other apps on the same system and "schedule the next thread" will not be the thread that the game intended but that of some other app and the latencies goes out the window so to speak.
This is why mutexes are a far better choice since when you lock it or wait on it you also inform the kernel/scheduler of what you do so it will take the correct action.
That benchmark didn't really measure that it thought that it measured, hopefully it looks like the dev took the hints from Linus correctly and became a better developer due to it, so in the end all turned to good from that.
Comment