Thread Priority when used from a pool

  • Thread starter Thread starter John Roberts
  • Start date Start date
J

John Roberts

Hi,

If I take a thread from the pool or process an asynchronous result (e.g. web
service or socket), can I lower the thread priority and if so, does it
automatically get restored to 'Normal' when it returns to the pool?

Kind regards,
- John
 
Good question John. Yes, you can change the priority of a thread while
running in one of those situations (or in a Timer callback). However, the
original priority will not be restored automatically when the callback
concludes which could lead to unpredictable results later one since the
thread may be reused for other purposes. So if you must change the
priority, please restore it to the original value before returning from the
callback.

In .NET CF version 2 (Whidbey), the original priority of a thread will be
automatically restored at the conclusion of the callback.

Brian

--------------------
From: "John Roberts" <[email protected]>
Subject: Thread Priority when used from a pool
Date: Thu, 14 Oct 2004 12:16:10 +0100

Hi,

If I take a thread from the pool or process an asynchronous result (e.g. web
service or socket), can I lower the thread priority and if so, does it
automatically get restored to 'Normal' when it returns to the pool?

Kind regards,
- John

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top