What should you recommend?

You are reviewing an existing Windows application that uses .NET Framework 4. When the
user clicks a button, the application sequentially processes thousands of image files
contained in a directory. The user interface becomes unresponsive while the application
processes the files. You have the following requirements: • Modify the button’s click event. •
Increase application throughput by processing multiple image files concurrently. • Ensure
that the user interface remains responsive while the application processes the image files.
You need to recommend an approach for meeting the requirements. What should you
recommend?

You are reviewing an existing Windows application that uses .NET Framework 4. When the
user clicks a button, the application sequentially processes thousands of image files
contained in a directory. The user interface becomes unresponsive while the application
processes the files. You have the following requirements: • Modify the button’s click event. •
Increase application throughput by processing multiple image files concurrently. • Ensure
that the user interface remains responsive while the application processes the image files.
You need to recommend an approach for meeting the requirements. What should you
recommend?

A.
Iterate over the image files by using the Parallel.ForEach() method. For each image file,
start a separate thread that processes the image file, by using the Thread.Start() method.

B.
Iterate over the image files. For each image file, use the Process.Start() method to
launch a console application that processes the image file.

C.
Use the Parallel.ForEach() method to process the images concurrently.

D.
Use the ThreadPool.QueueUserWorkItem() method to queue up a single work item that
uses the Parallel.ForEach () method to process the image files concurrently.



Leave a Reply 0

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