Help for this page

Select Code to Download


  1. or download this
    #pragma warning(disable:4996)
    #include <windows.h>
    ...
        );
        return 0;
    }
    
  2. or download this
    C:\test>for %t in (1,2,4,16,63,255) do @interlock %t 10000000
       1 threads x   10000000 iterations of normal increment non-shared to
    +ok   0.269178904 seconds
    ...
    1023 threads x    1000000 iterations of normal increment non-shared to
    +ok 7.115383938 seconds
    1023 threads x    1000000 iterations of    interlockedIncrement16() to
    +ok 127.386793294 seconds
    1023 threads x    1000000 iterations of normal increment shared     to
    +ok 112.850957873 seconds