Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chronicle V4 - is concurrent write on same Chronicle queue safe

I am planning to use chronicle 4 (SingleChronicleQueue) for IPC .

I was using chronicle 3 previous (IndexedQueue ) and it was not thread safe and I used to create multiple queues per thread but i was told by some one by using SingleChronicleQueue i can use 1 queue for all threads in a JVM .

But does it stand good if 2 different processes are trying to write concurrently in same chronicle queue would it be safe ?

Is this recommended to do or for different processes I need to create different queues.

like image 791
user3887600 Avatar asked Sep 11 '25 02:09

user3887600


1 Answers

Thank you for the question about Chronicle Software products.

The relevant link in the documentation is: https://github.com/OpenHFT/Chronicle-Queue#single-chronicle-queue

The key phrase being: "concurrent writers on the same machine".

Chronicle-Queue uses compare-and-swap operations to atomically mutate the shared off-heap memory that backs a queue instance, so multiple processes can write, and read to/from a queue on the same machine.

I hope this answers your question.

Best Regards, Terry

like image 161
Terry Williams Avatar answered Sep 15 '25 21:09

Terry Williams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!