Reducing Lock Overhead

Lock overhead is the time spent in creating, destroying, acquiring, and releasing locks. Lock overhead does not include the time spent waiting for a lock held by another task - that is called lock contention. You can think of lock overhead as the cost of the lock operations themselves assuming the lock is always available.

If possible, restructure you code to reduce Lock overhead by creating a private copy of an object for each task to avoid the need to acquire a lock - see the help topic Problem Solving Strategies.

For more complete information about compiler optimizations, see our Optimization Notice.