I should implement a class in Visual C++ with a queue; in this queue I've to do atomic operation. Searching on the web, I found the class std::atomic , but I keep some questions. The first is: what's the difference among:
A) atomic <queue <T>> fifo;
B) queue <atomic <T>> fifo; ?
The second question is: how can I make atomic operation like push?
push (T.load)
is the right solution?
The last question is: if I protect some operation on a queue with a mutex, still I have the need to do atomic operation on it?
Any advice is appreciated, Greetings
Aucun commentaire:
Enregistrer un commentaire