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:
- Build and run the application. A window will appear with a button and a progress bar.
- Click on the button. You will see the progress bar filling up, as shown in the following image:
- Once finished, you will see the label showing the seconds it took to complete the loop. Close the window and return to the IDE.
- Close Visual Studio or Visual C# and run the generated executable (
ParallelTester.exe). A window will appear again, with a button ...