I have some code where a thread callback effectively generates some data and writes it to a queue to be consumed by another thread looking something like this
auto data_ptr = std::make_shared<DataFrame>();
data_queue_.write(std::move(data_ptr));
I know it was written this way as to avoid copies when reading and writing from the queue. I need to instantiate another thread to consume and do some work with this data. Will doing something like this even be logical
# Adding this
custom_queue_.write(std::move(data_ptr));
Does that mean that the object only gets deleted when it gets pulled out of both of the threads reading from this queue and then only the data_ptr memory allocated gets deleted?