Does Boost Asio udp sockets still require multiple sockets for concurrent access?

I was reading an old email list from 2007 that claims that if you use a single UDP socket, you cannot call concurrent operations on it, but if you have multiple sockets, you can.

https://sourceforge.net/p/asio/mailman/message/8324732/

I do try to think about not doing premature optimization, but I believe using multi threading is absolutely mandatory because I like to not hang the I/O when i drag my window, or scroll in the terminal window (I also already have the system already set up)...

I just don't want to use unnecessary strands / locks, while having ease for future optimization.
Generally: Two objects that are independent (i.e. do not share any resources like memory) can be used in different threads without synchronizing/locking. That applies to sockets like for any other object. In that case you do not have concurrent access.


Notice that you may not need locking in a concurrent access scenario. Especially for simple data types. See atomic:

http://www.cplusplus.com/reference/atomic/atomic/?kw=atomic
Topic archived. No new replies allowed.