What should you do to define the signature of the method that will contain the code to perform the asynchronous operation?

You are busy writing a code to perform an asynchronous operation. You must adjust the priority of the thread that executes the asynchronous operation. The operation is must be specified to use input data from the main thread. What should you do to define the signature of the method that will contain the code to perform the asynchronous operation?

You are busy writing a code to perform an asynchronous operation. You must adjust the priority of the thread that executes the asynchronous operation. The operation is must be specified to use input data from the main thread. What should you do to define the signature of the method that will contain the code to perform the asynchronous operation?

A.
You should create a method that matches the AsyncCallback delegate’s signature.

B.
You should create a method that matches the ParameterizedThreadStart delegate’s signature.

C.
You should create a method that matches the ThreadStart delegate’s signature.

D.
You should create a method that matches the DoWorkEventHandler delegate’s signature.

Explanation:
You need to create a method that matches the ParameterizedThreadStart delegate’s signature. This will then accepts a single Object instance as a parameter.

Incorrect Answers:
A: The AsyncCallback allows you to define a method that represents an asynchronous operation’s callback.
C: The parameters are not accepted by the ThreadStart. Because of this, you cannot use it to supply input data to the asynchronous operation.
D: The DoWorkEventHandler delegate’s signature is supported by the BackgroundWorker. The BackgroundWorker do not ajust priority of the BackgroundWorker thread



Leave a Reply 0

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