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

Cancelling the job

Executing a time-consuming process in an independent thread allows us to work in concurrent tasks and show the progress easily. Besides, one of the great advantages of doing this is the possibility to allow the user to go on using the controls in the graphical user interface without the usual aforementioned restrictions of single-threaded applications. For example, perhaps he or she wishes to cancel the process if it takes more time than expected.

The BackgroundWorker component simplifies the task of cancelling the execution of the code running in the thread it creates without having to make a big programming effort. In order to ease the cancellation of the execution of the code programmed in the BackgroundWorker DoWork event ...

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