How about a switch statement where you set the thread priority depending on
what kind of test it is? Something like this:
Thread t = new Thread(...); // create a thread object somehow.
switch(TestType) {
case "parallel":
t.Priority = ThreadPriority.BelowNormal; // or .Lowest if you prefer
case "serial":
t.Priority = ThreadPriority.Normal; // or .AboveNormal if you
prefer.
default:
t.Priority = Normal;
}
t.Start();
Or am I missing the point of your question? This answer seems too easy, so
maybe I'm not getting what you're really asking.
--
I may not always have the best answers, but at least I'm not posting
questions in the wrong newsgroups...
"Steve Teeples" <St**********@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
I have a test application that will run multiple types of tests. Some are
quite short (milli-seconds to seconds) and can run in parallel and others
need to run serially - they take several minutes to run. I've done some
reading and it doesn't seem that pooling will meet my needs because I
can't
define priorities. Does someone have an example of how I can create and
manage various threads by priority levels? For example, I may have (3)
test
cases that can run in parallel and therefore are priority 2. I have (2)
test
cases that need to run alone and are therefore priority 1. The test cases
could come at me in any order.
--
Steve