I'm writing an IOCP based server. For each connection to the server, I maintain a connection object that contains some context and state about that particular connection. When a client disconnects, I'd like to close the socket handle and free the connection object. However, a worker thread might free a connection object while another is accessing it. When can I be sure that the object is safe to free? I considered reference counting or shared smart...