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 - Running many processes in parallel

We are not yet able to take full advantage of multiprocessing, but we know how to set a process affinity. This way, we should be able to take full advantage of every available core.

We are going to do that and monitor the CPU usage when running many instances of our simple application in a multiprocessing computer using the Task Manager:

  1. Close Visual Studio or Visual C# and run as many instances of the generated executable (ParallelTester.exe) as there are available cores or processors are in the system. For example, if you have a dual core microprocessor, you will run it twice, and if you have a quad core microprocessor, you will run it four times. Do not click the buttons yet.
  2. Close any other ...

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