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 —Overriding methods in the coordination subclass

We have created the algorithm coordination subclass, and added the variables, properties, and methods needed for the sunspot analyzer algorithm.

Now, we are going to fill in the gaps overriding the necessary methods to define the code for creating and coordinating the pieces. Thus, we are going to represent the complete sunspot analyzer parallel algorithm:

  1. Stay in the project, SunspotsAnalyzer.
  2. Move to the SunspotAnalyzer : ParallelAlgorithm class code area.
  3. Override the StartThreadsAsync method to force a garbage collection before starting the threads with an asynchronous execution:
    public override void StartThreadsAsync() { // Call the garbage collector before starting each thread ...

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