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 - Changing the cores available for a process

Now, we will change the processor affinity while our application is running. This way, we are going to understand the way Windows works with multiprocessing:

  1. Build and run the application. A window will appear with a button and a progress bar.
  2. Click on the button. You will see the progress bar filling up, as shown in the following image:
    Time for action - Changing the cores available for a process
  3. Once finished, you will see the label showing the seconds it took to complete the loop. Close the window and return to the IDE.
  4. Close Visual Studio or Visual C# and run the generated executable (ParallelTester.exe). A window will appear again, with a button ...

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