If I am running a single an boost::asio::io_service with a thread pool and wrapping a particular socket receive using a boost::asio::strand to simulate single threaded operation, does anyone know if the strand meets the requirements to safely produce to a boost::lockfree::spsc_queue even though I will be producing from different threads but guaranteed to only produce one at a time.
            Asked
            
        
        
            Active
            
        
            Viewed 343 times
        
    1
            
            
        
        schuess
        
- 1,009
 - 1
 - 10
 - 21
 
1 Answers
1
            
            
        Yes. Serialization through a strand guarantees what you are after. To extend this a little bit, if you have multiple stands (for multiple sockets for example) - then no such guarantee exists across multiple strands pushing to the same queue.
        Nim
        
- 33,299
 - 2
 - 62
 - 101
 
- 
                    Thanks, I'll give this a shot. – schuess May 25 '17 at 15:43