What value of the threadPoolThreadCount should you identify after the code is executed?

ThreadStart threadStart = delegate

{
}
ParameterizedThreadStart parameterizedThreadStart = delegate[object args]
{
}
int threadPoolThreadCount = 0
Thread thread1 = new Thread[threadStart];
Thread thread2 = new Thread[parameterizedThreadStart]; Thread thread3 = new Thread[threadStart];
thread1.Start[];
thread2.Start[null];
thread3,Start[];
if [thread1.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
if [thread2.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
if [thread3.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
What value of the threadPoolThreadCount should you identify after the code is executed?

ThreadStart threadStart = delegate

{
}
ParameterizedThreadStart parameterizedThreadStart = delegate[object args]
{
}
int threadPoolThreadCount = 0
Thread thread1 = new Thread[threadStart];
Thread thread2 = new Thread[parameterizedThreadStart]; Thread thread3 = new Thread[threadStart];
thread1.Start[];
thread2.Start[null];
thread3,Start[];
if [thread1.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
if [thread2.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
if [thread3.IsThreadPoolThread]
{
threadPoolThreadCount++;
}
What value of the threadPoolThreadCount should you identify after the code is executed?

A.
0

B.
2

C.
3

D.
1

Explanation:
The value of the threadPoolThreadCount is set at 0. The threads that are manually made are not class as thread pool threads. The threads that are created by calling the QueueUserWorkItem method of the ThreadPool are class thread pool threads.



Leave a Reply 0

Your email address will not be published. Required fields are marked *