Wednesday, June 11, 2014

Multithreading

All multitasking systems have a scheduler. A scheduler decides what unit of work will execute next. A basic scheduler can be something that runs of a high resolution timer (like, say, every 100ms, a task switch happens). Clearly, modern implementations are much more complicated than that.
That said, most modern threading implementations rely on a scheduler within the kernel. Many of these schedulers are NOT deterministic. That is, there is no guarantee that a context switch (i.e. a switch between runnable instances managed by the scheduler) will happen at any specific time.
What you are seeing are the discrepancies in that scheduler for your system.

No comments:

Post a Comment