Export (0) Print
Expand All

Threading Sample

This sample demonstrates various thread activities:

  • Creating and executing a thread.
  • Thread synchronization.
  • Interaction between threads.
  • Using a thread pool.

This sample contains the source code for the Threading Tutorial.

Building and Running the Sample Within Visual Studio

To build and run the Threading samples

  1. Open the solution (Threads.sln).
  2. In Solution Explorer, right-click the StopJoin project and click Set as StartUp Project.
  3. From the Debug menu, click Start Without Debugging.
  4. Repeat the preceding steps for MonitorSample, SimplePool, and Mutex.

Building and Running the Sample from the Command Line

To build and run the Threading samples

  1. Use the Change Directory command to change to the Threads directory.
  2. Type the following:
    cd StopJoin
    csc StopJoin.cs
    StopJoin
    
  3. Type the following:
    cd ..\MonitorSample
    csc MonitorSample.cs
    MonitorSample
    
  4. Type the following:
    cd ..\SimplePool
    csc SimplePool.cs
    SimplePool
    
  5. Type the following:
    cd ..\Mutex
    csc Mutex.cs
    Mutex
    

See Also

Threading Tutorial | Tutorial Samples

Show:
© 2014 Microsoft