1. Atlassian
  2. Project: Atlassian
  3. atlassian-util-concurrent

Wiki

Clone wiki

atlassian-util-concurrent / Home

This project contains utility classes that are used by various products and projects inside Atlassian and may have some utility to the world at large.

Of most general value in production code are:

References:

Maps:

  • CopyOnWrite Maps for thread-safe read mostly Maps
  • ConcurrentOperationMap for dealing with operations that may interfere if run concurrently, such as inserting an object into a database (deprecated, prefer Guava's ComputingMap)

Locks:

  • ManagedLock for performing operations under lock where the actual lock used may be striped using an arbitrary function

Atomics:

Parallel/Completion

  • AsyncCompleter for performing operations in parallel and gathering their results as they arrive.

Latches:

  • BooleanLatch a simple Latch that allows a reader thread to wait for a signal
  • PhasedLatch a phased latch that allows threads to wait for specific phases to be complete before continuing

The other classes are mostly useful for test code.

Downloads

The jar can be downloaded directly from our Maven repository or via the Maven dependency:

<dependency>
  <groupId>com.atlassian.util.concurrent</groupId>
  <artifactId>atlassian-util-concurrent</artifactId>
  <version>2.0.0</version>
</dependency>

Licensing

This code is open source and licensed under Version 2 of the Apache License.

Updated