Implementation of a RingBuffer in Java with optional FIFO like semantics

Viewed 23
The implementation of a RingBuffer in Java, particularly with the option for FIFO-like semantics, has stirred mixed reactions among users. Critics point out that such implementations can lead to complexity and bugs, undermining their effectiveness. Specific concerns include the unnecessary complications introduced by options like `orderedReads`, which some feel adds more potential for errors than it resolves. Additionally, the necessity of passing a class type to the constructor raises questions about design choices. The discussion also highlighted a potential alternative method using a Deque for similar functionality, and it noted that some standard libraries might offer better options than custom implementations. The mention of the 'Disruptor' framework suggests that there are advanced patterns in Java for concurrent programming that may be worth exploring. Overall, users express frustration with reliance on outdated versions of Java, such as Java 8, that may limit modern development practices.
0 Answers