Microsoft
70-518 · Question #235
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 D. 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 by using the Parallel.ForEach() method.
- BIterate over the image files.
- CUse the Parallel.ForEach() method to process the images concurrently.
- DUse the ThreadPool.QueueUserWorkItem() method to queue up a single work item that uses
How the community answered
(46 responses)- A2% (1)
- B7% (3)
- C17% (8)
- D74% (34)
Community Discussion
No community discussion yet for this question.