I am involved a task of listening to a web service. Which will send a xml data through push service. The data have to undergo some calculation and then it will we displayed.
I have planned to use queue to store the data by service listener and read the data by the business logic code. It is a pure single producer single consumer queue.
Since I have to receive the data as web service push, I have to always open to receive the data and push it to the queue. I thought of using boost_lockfree_spsc_queue
. Because, if it were a lockable queue the listener have to wait for a while to acquire the lock, as opposed to it boost_lockfree_spsc_queue
does not need any locks.
The data I am going to store is
struct MemoryStruct {
char *memory;
size_t size;
};
And the queue is
boost::lockfree::spsc_queue<MemoryStruct*> lockFreeQ{100};
After reading performance section here I got bit confused.
Is it safe to use this boost_lockfree_spcc_queue for production purposes. Or should I use standard queue (C++ 11 )with locks?
Thanks