The methods "int Comm::connect(struct sockaddr_in &addr,DispatchHandlerPtr
&default_handler_ptr)"
and
"int Comm::connect(struct sockaddr_in &addr, struct sockaddr_in &local_addr,
DispatchHandlerPtr &default_handler_ptr)"
are not thread-safe, they would cause asserion failed (read color
highlighted) in the
"
 void HandlerMap::insert_handler(IOHandler *handler) {
      ScopedLock lock(m_mutex);
      assert(m_handler_map.find(handler->get_address()) ==
m_handler_map.end());
      m_handler_map[handler->get_address()] = handler;
    }
"

Since the above two "Comm::connect(...)" methods only use "bool
HandlerMap::contains_handler(const sockaddr_in &addr)" method to
to ensure there is not a connection to the same destination, and then use "
void HandlerMap::insert_handler(IOHandler *handler)" to insert
the connection information, but these two
"HandlerMap::contains_handler(...)" and "HandlerMap::insert_handler(...)"
can not provide a atom
operation, so the assertion in the "HandlerMap::insert_handler(...)" would
happen if  two threads connect to a same destination on the same time.

-- 
You received this message because you are subscribed to the Google Groups 
"Hypertable Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hypertable-dev?hl=en.

Reply via email to