low-latency-primitive-concurrent-queues 0

Low latency, lock free, primitive bounded blocking queues backed by an primitive arrays such as an int[]. These classes mimic the interface of BlockingQueue, they work with primitive rather than Objects so are unable to actually implement the BlockingQueu

3 years after Apache-2.0

Faster than ArrayBlockingQueue

PerformanceComparison

Aim

Our aim is to be extremely low latency with near zero GC overhead.

An example of how to use on of our low latency bounded queues.


// writer thread
Executors.newSingleThreadExecutor().execute(new Runnable() {
    @Override
    public void run() {
        queue.add(1);
    }
});

// reader thread
Executors.newSingleThreadExecutor().execute(new Runnable() {
    @Override
    public void run() {
        final int value = queue.take();
    }
});

Maven Central

We are hosted at [Maven Central] (http://search.maven.org), one of the quickest ways to get up and running is to add this Maven dependency to your pom file :

<dependency>
    <groupId>uk.co.boundedbuffer</groupId>
    <artifactId>low-latency-primitive-concurrent-queues</artifactId>
    <version>1.0.1</version>
<dependency>

JavaDoc

Having trouble ? Check out our documentation at [JavaDoc] (http://robaustin.github.io/low-latency-primitive-concurrent-queues/apidocs/)

Is this Queue Thread Safe ?

Yes - it's thread safe, but you are limited to using just two threads per queue instance, One producer thread and a consumer thread.

Why am I limited to only using just two threads ?

The queues take advantage of the Unsafe.putOrderedX(), which provides non-blocking code with guaranteed writes. These writes will not be re-ordered by instruction reordering, they use a faster store-store barrier, rather than the the slower store-load barrier ( which is used when doing a volatile write ). One of the trade offs with this improved performance is the visibility of the reads and writes between cores.

Licence

Apache v2

Contributors

Contributors are extremely welcome, just fork this project, make your changes, and we'd be happy to review your pull-request.

Support or Contact

Having Problems ? Contact [email protected] and we’ll help you sort it out.

Blog

If you are interest in low latency java, see my blog at [http://robsjava.blogspot.co.uk] (http://robsjava.blogspot.co.uk)

Related Repositories

distsys-class

distsys-class

Class materials for a distributed systems lecture series ...

support

support

An evented server framework designed for building scalable and introspectable se ...

awesome-java

awesome-java

A curated list of awesome Java frameworks, libraries and software. ...

awesome-java

awesome-java

A curated list of awesome Java frameworks, libraries and software. ...

awesome-c

awesome-c

A curated list of awesome C frameworks, libraries and software. ...


Top Contributors

RobAustin

Releases

-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar
-   low-latency-primitiv zip tar