When producing or consuming many elements, the most efficient way is to: 1) Use one of the bulk-operation methods of the queue with a token 2) Failing that, use the bulk-operation methods without a token 3) Failing that, create a token and use that with the single-item methods 4) Failing that, use the single-parameter methods of the queue Having said that, don't create tokens willy-nilly -- ideall
| 425 | // Having said that, don't create tokens willy-nilly -- ideally there should be |
| 426 | // a maximum of one token per thread (of each kind). |
| 427 | struct ProducerToken; |
| 428 | struct ConsumerToken; |
| 429 | |
| 430 | template<typename T, typename Traits> class ConcurrentQueue; |