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 - Testing parallelism capabilities with processes

Now, we are going to use our C# application with command-line arguments that will tell it the iteration bounds (where to begin and where to end). This way, we will be able to know whether it is possible or not to achieve a better performance for our simple application dividing its task into as many processes as available cores.

  1. Depending on the number of cores or processors available in the system, calculate the beginning and end of the iterations for each application's instance. Remember that the application must process 36,000,000 iterations. The following table shows an example for a quad core system in which each instance will process 9,000,000 iterations (9,000,000 x 4 = 36,000,000): ...

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