Multi threaded circular buffer
I highly recommend Java Concurrency in Practice by Brian Goetz et al. This will give you a solid foundation for building multi-threaded Java applications.

The biggest problem with RingBuffer is that it is not thread-safe. You must synchronize all read and write operations to be certain to see the latest values for fields. This doesn't mean you have to lock the structure the entire time.

This is explained far better in the book than I can here. The short of it is that without synchronization via memory barriers, the JVM is free to cache values read in one thread and miss writes happening in another.


Thread A calls get and sees that the buffer is empty.
Thread B calls add which updates the pointer.
Thread A calls get again, but without a memory barrier the cached pointer value tells it that the queue is still empty.


You'll need to add synchronization to guard any access of the pointers and size. Sometimes you can merely add synchronized to the method, but this usually hurts performance. You want to shrink your synchronized blocks to the bare minimum; prefer using synchronized (&lt;lock&gt;) blocks over synchronized methods.

Here are some other suggestions unrelated to concurrency:


RingBuffer composes an ArrayList so it should not extend AbstractList itself. It shouldn't even implement the basic List interface nor RandomAccess because it doesn't truly support the get operation. It should implement Queue instead.
As written, get allows reading outside the buffer. Are you sure you want to support this? See (1) above.
You don't need a class to hold an integer pointer given that it is internal to RingBuffer. A simple int is sufficient.
The modulo operator % should handle negative values already (test this!) so wrap could be simplified.