O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

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

WPF example with a synchronous BackgroundWorker

We are used to synchronous execution when we work with a single thread. This mechanism executes the next instruction once the current instruction processing is completed.

When a synchronous method is called, it runs on the same thread and the program flow goes into the method's code. Once it returns from the method with or without a result, it goes on with the instruction next to the method call. There is no code in the method left for later execution, because it finishes when it returns the control to the caller. The main program has to wait for the method to complete its execution in order to go on with the next set of instructions.

This is what happens when you debug a single-threaded application, ...

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