Re: Detecting scheduler interference?
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Fri, 27 Feb 2009 07:47:49 -0800
Thread priority doesn't affect its timeslice length. It only affects whether
it will get the time slice. At any given moment, a thread ready to run with
the highest priority will get the processor. If there are several threads
with highest priority, they will be scheduled round-robin.
"JJ" <jcunews@xxxxxxxxxxxxx> wrote in message
news:Oc3D9GMmJHA.1252@xxxxxxxxxxxxxxxxxxxxxxx
drtodd13@xxxxxxxxxxx wrote:
time it is 10 microseconds but sometimes 10-20 milliseconds. If I run
the program with real-time priority then the number of spikes
decreases by roughly half. What I would like to do is prove the
hypothesis that the scheduler doing this. Is there some way to use
the thread information block (or anything else) to detect if this
thread has been unscheduled/rescheduled while running this function?
Even though a realtime process with a realtime thread (with priority
boost) has longer time slice than the system threads, IMO, other threads
are still running. It's just that they have much shorter time slice.
Other interferences are hardware interrupts (IRQ) (e.g. clock, keyboard)
which have the topmost priority and will interrupt anything and execute
the assigned IRQ handler - a system code. Although the system code might
have lower priority than the realtime process+thread, the hardware
interrupt has already take place. IRQs can be disabled (in kernel mode),
but not all of them. There is at least one that can not be disabled.
One way to detect interference is by looking at the thread's number of
context switches. Each context switch can mean either pausing or resuming
a thread (out or in to the scheduled thread).
More on this can be found in MSDN page entitled "Scheduling Priorities"
and "Context Switches".
.
- References:
- Detecting scheduler interference?
- From: drtodd13
- Re: Detecting scheduler interference?
- From: JJ
- Detecting scheduler interference?
- Prev by Date: Re: Detecting scheduler interference?
- Next by Date: Re: Detecting scheduler interference?
- Previous by thread: Re: Detecting scheduler interference?
- Next by thread: Re: Detecting scheduler interference?
- Index(es):
Relevant Pages
|