Intel® VTune™ Amplifier 2016

Remove Lock

In the Source window, you located the mutex that caused a significant wait while the processor cores were underutilized and generated multiple wait count. Focus on this line and do the following:

  1. Open the code editor.

  2. Modify the code to remove the lock.

Open the Code Editor

Click the Source Editor button to open the analyze_locks.cpp file in your default editor at the hotspot code line:

Remove the Lock

The rgb_mutex was introduced to protect calculation from multithreaded access. The brief analysis shows that the code is thread safe and the mutex is not really needed.

To resolve this issue:

  1. Comment out code lines 165 and 172 to disable the mutex.

  2. Save the changes made in the source file.

  3. Browse to the directory where you extracted the sample code (for example, /home/myuser/samples/tachyon).

  4. Rebuild your target in the release mode using the make command as follows:

    $ make clean

    $ make

    The tachyon_analyze_locks application is rebuilt and stored in the tachyon directory.

  5. Run tachyon_analyze_locks as follows:

    $ ./tachyon_analyze_locks dat/balls.dat

    System runs the tachyon_analyze_locks application. Note that execution time reduced from 11.632 seconds to 0.800 seconds.

Key Terms

Hotspot

Next Step

Compare with Previous Result