<b>Tag:</b> lock-strategies <span class="since">since 2.0</span> <span class="tagdoc" id="ivysettings.lock-strategies">Defines a list of lock strategies usable in Ivy.</span> A lock strategy is used by a cache manager to decide when and how locking should be performed (see [[settings/cache]] to see how to configure the lock strategy to use). Two lock strategies are registered by default: <ul> <li><b>no-lock</b></li> This lock strategy actually performs no locking at all, and thus should not be used in an environment where the cache is shared by multiple processes. This strategy is implemented by ([[svn:src/java/org/apache/ivy/plugins/lock/NoLockStrategy.java NoLockStrategy]]) <li><b>artifact-lock</b></li> This strategy acquires a lock whenever a module descriptor or an artifact is downloaded to the cache, which makes a good solution when you want to share your repository cache. Note that this strategy is based on file locking, performed by default using the java.io.File.createNewFile() atomicity (which is documented as atomic in the javadoc, but not recommended to perform locks). A java.nio.FileLock based implementation is also provided, but according to our tests the createNewFile based one performs better and more reliably. We heavily recommend making your own testing in your target environment before relying on this lock strategy for heavily concurrent operations. This strategy is implemented by ([[svn:src/java/org/apache/ivy/plugins/lock/ArtifactLockStrategy.java ArtifactLockStrategy]]) </ul> The child tag used for the lock strategy must be equal to a name of a lock strategy type (added with the typedef tag). <h1>Child elements</h1> <table class="ivy-children"> <thead> <tr><th class="ivy-chld">Element</th><th class="ivy-chld-desc">Description</th><th class="ivy-chld-card">Cardinality</th></tr> </thead> <tbody> <tr><td>any lock strategy</td><td>adds a lock strategy to the list of available ones</td> <td>0..n</td></tr> </tbody> </table>