You work as the application developer at Domain.com.
You need to modify the code of an application.
The application uses two threads named thread A and thread B. You want thread B to complete executing before thread A starts executing.
How will you accomplish the task?
A.
Define thread A to run at a lower priority.
B.
Define thread B to run at a higher priority.
C.
Implement the WaitCallback delegate to synchronize the threads.
D.
Call the Sleep method of thread A.
E.
Call the SpinLock method of thread A.
Explanation:
Note: Some confusion why the answer is C. Using the ThreadPool and WaitCallBack will not synchronise the threads, they will run in the background in parallel
Correct answer is C