I have two threads, where one is a consumer and other is a producer.
Lets assume that the producer generates 1K of data at a memory location, and would like to tell the consumer thread to process this data. Is it enough for me to transfer this data by pushing a pointer to the data on a tbb's concurrent queue? Or do I have to explicitly add a write memory barrier and a read memory barrier so that the change can be seen on the other thread?
Basically, I want to guarantee that the data that the consumer thread sees after dereferencing the pop'd value is going to be what the producer thread generated.
Another way to ask the question is: does tbb's queue have any memory barriers built in?