Microsoft
70-518 · Question #107
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 correct answer is B. Use the ThreadPool.QueueUserWorkItem() method to queue up a single work item that uses. See the full explanation below for the reasoning.
Question
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?
Options
- AIterate over the image files. For each image file, use the Process.Start() method to launch a
- BUse the ThreadPool.QueueUserWorkItem() method to queue up a single work item that uses
- CUse the Parallel.ForEach() method to process the images concurrently.
- DIterate over the image files by using the Parallel.ForEach()method. For each image file, start
How the community answered
(33 responses)- A6% (2)
- B70% (23)
- C9% (3)
- D15% (5)
Community Discussion
No community discussion yet for this question.