Question:You will create an application that starts a new Thread object to run a method. You want the Thread to run as quickly as possible, even if that means it receives more processor time than the foreground thread. Which code sample does this correctly? - VB.NET 

A Dim DoWorkThread As New Thread(New ThreadStart(AddressOf DoWork))
DoWorkThread.ThreadState = ThreadState.Running
DoWorkThread.Start()
 

B Dim DoWorkThread As New Thread(New ThreadStart(AddressOf DoWork))
DoWorkThread.Priority = ThreadPriority.Highest
DoWorkThread.Start() 

C Dim DoWorkThread As New Thread(New ThreadStart(AddressOf DoWork))
DoWorkThread.Priority = ThreadPriority.Lowest
DoWorkThread.Start()
 

D Dim DoWorkThread As New Thread(New ThreadStart(AddressOf DoWork))
DoWorkThread.ThreadState = ThreadState.WaitSleepJoin
DoWorkThread.Start() 

+ Answer
+ Report
Total Preview: 1129

Copyright © 2024. Powered by Intellect Software Ltd