Thread Priority when used from a pool

3 views
Skip to first unread message

John Roberts

unread,
Oct 14, 2004, 7:16:10 AM10/14/04
to
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


Brian Smith [MSFT]

unread,
Oct 18, 2004, 8:29:40 PM10/18/04
to
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" <tvco...@community.nospam>
>Subject: Thread Priority when used from a pool
>Date: Thu, 14 Oct 2004 12:16:10 +0100

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

Reply all
Reply to author
Forward
0 new messages