First question:

I have read that you cannot change the thread priority of a thread pool
thread. They always run at normal. Is this true?

Second question:

If I manage my own thread pool of thread objects, must the thread priority
be set before calling thread.start? Can the priority be changed on the fly
while the thread is running with thread.currentthread.priority?

Thanks

Re: Threadpool and thread priority question by Jon

Jon
Wed Jan 05 12:34:43 CST 2005

Kevin Jackson <kjackson@powerwayinc.com> wrote:
> First question:
>
> I have read that you cannot change the thread priority of a thread pool
> thread. They always run at normal. Is this true?

Not sure - but fairly easy to test.

> Second question:
>
> If I manage my own thread pool of thread objects, must the thread priority
> be set before calling thread.start? Can the priority be changed on the fly
> while the thread is running with thread.currentthread.priority?

I believe it can, yes. If you're thinking of implementing your own
thread pool, you might want to have a look at mine first and modify it.
It's in my MiscUtil library:
http://www.pobox.com/~skeet/csharp/miscutil

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Re: Threadpool and thread priority question by Kevin

Kevin
Wed Jan 05 13:43:18 CST 2005


Nice class. I believe this is exactly what we are looking for. We want to
control the execution of threads from the ThreadPool by queued priority AND
thread priority. Your classes manage the executing thread in the pool based
on queue priority and we can set the thread priorities ourselves.

Thanks

Kevin

"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1c46439e39ff740898bb9d@msnews.microsoft.com...
> Kevin Jackson <kjackson@powerwayinc.com> wrote:
>> First question:
>>
>> I have read that you cannot change the thread priority of a thread pool
>> thread. They always run at normal. Is this true?
>
> Not sure - but fairly easy to test.
>
>> Second question:
>>
>> If I manage my own thread pool of thread objects, must the thread
>> priority
>> be set before calling thread.start? Can the priority be changed on the
>> fly
>> while the thread is running with thread.currentthread.priority?
>
> I believe it can, yes. If you're thinking of implementing your own
> thread pool, you might want to have a look at mine first and modify it.
> It's in my MiscUtil library:
> http://www.pobox.com/~skeet/csharp/miscutil
>
> --
> Jon Skeet - <skeet@pobox.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too