Boost logo

Boost Users :

Subject: Re: [Boost-users] segmentation fault using boost asio in linux.
From: Igor R (boost.lists_at_[hidden])
Date: 2012-05-15 11:12:56


> I see what you are saying. let's say DispatchSend is called between
> StartSend and HandleSend.
> However, we do push_back a new element to the list in DispatchSend().
> Adding a new element is still a problem?

It depends on the type of m_pending_sends - if it's std::vector, its
iterators are invalidated on push_back.

> you think i should mutex these push_back and erase operations? I though io_strand handles all these issues.

strand only guaratees that handlers won't be invoked concurrently:
http://www.boost.org/doc/libs/1_49_0/doc/html/boost_asio/reference/io_service__strand.html


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net