threading

  • Thread starter Thread starter Moshe Peleg
  • Start date Start date
M

Moshe Peleg

Can a high priority thread intercept a lower priority thread in the middle
of a function ?
 
Moshe,

Any thread can potentially interrupt any other in the middle of anything,
although it's the OS that actually changes which thread gets a chance to
run.
 
Depends on what you mean by "intercept".

The scheduler will preempt execution of lower priority threads with higher
priority threads. There are some cases where the priority of a thread gets
increased by the scheduler to prevent inversion or deadlocking, and a thread
has a quantum, so it might not run to full completion if it takes a long
time (> 50ms) and there is another thread at the same priority waiting.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Thank you very much.


Depends on what you mean by "intercept".

The scheduler will preempt execution of lower priority threads with higher
priority threads. There are some cases where the priority of a thread
gets increased by the scheduler to prevent inversion or deadlocking, and a
thread has a quantum, so it might not run to full completion if it takes a
long time (> 50ms) and there is another thread at the same priority
waiting.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
Back
Top