How to do it...

  1. Open Visual Studio 2017.
  2. Now, open the solution from the previous recipe. Click File | Open | Open Project/Solutionor press Ctrl + Shift + Oand select the Chapter6.ThreadPools solution. 
  3. Press Ctrl + Shift + B for a quick build to check that everything is fine. 
  4. Click on the Chapter6.ThreadPools solution label. Click File | Add | New Project.
  5. In the Add New Project template dialog box, expand the Visual C# node in the left-hand pane. 
  6. Select Windows Classic Desktop and select Console App (.NET Framework) in the right-hand pane:
  1. In the Name: textbox, type Chapter6.ThreadPools.PoolConsole as the name of the project. The rest of the fields can be left as they are: 
  1. Click OK.
  2. Now, the Solution Explorer (press Ctrl + Alt + L) should look like this: 
  1. Right-click on the References label in the Chapter6.ThreadPools.PoolConsole.
  2. Select Add Reference.

 

  1. In the Reference Manager, click on the Projects label in the right-hand pane: 
  1. Check Chapter6.ThreadPools.PoolLib project in the left-hand pane.
  2. Click OK.
  3. Double-click on the Program.cs label in the Solution Explorer.
  4. Scroll up in the code window and add the following using directive:
      using Chapter6.ThreadPools.PoolLib;
  1.  Let's add the code inside the Main() method:
      var pool = new ThreadList();
var output = pool.ProcessPool();

Console.WriteLine(output);

Console.ReadLine();
  1. Now, press F5 to test our application:
  1.  Press Enter to exit the application.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.202.54