I have soft real-time .NET application run on W2008R2.
I just realised that I cant explain how precisely threads are being scheduled.
And for my embarassement I dont know how it works down to OS threads at all.
So I will explain what I know and I'd appreciate if anyone could help me to fill the gaps and refer me to a simple description of algorithms which are used in .NET and Windows to schedule threads.
My code runs in managed threads. As I know managed threads (lets call them .NET threads) run in unmanaged threads (lets call them OS threads).
I know that threads are competing for CPU time and other resources. And that there is a piece of software - scheduler which monitors resources and threads and make the whole thing work.
Here I am not sure - is the scheduler just one for the OS or there is also .NET scheduler which schedules .NET threads? And if there are two schedulers then how they are working together?
And what are the rules to schedule a thread?
I want to narrow this question to a thread which does only arithmetic computations and no access to any devices so we are talking purely CPU consuming thread.
How scheduler factors .NET thread priority, process priority and a shared resource (CPU in this case) ?