O'Reilly logo

C# 2008 and 2005 Threaded Programming: Beginner's Guide by Gastón C. Hillar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - Updating the UI while running threads

You need more time to finish the final release for your extremely efficient encryption engine. You therefore decide to distract the FBI agents by showing some small improvements in the application. You want to display some feedback in the UI while the thread is encrypting. But, you do not want to lose too much performance in that because they are expecting an impressive encryption speed. However, you do not know how to do it using threads, and you do not want to lose time. Hence, the BackgroundWorker is here to help you!

Now, we are going to make some changes to the application, adding a BackgroundWorker to display progress. In order to accomplish that, we must share data between two threads: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required