Boost logo

Boost Users :

Subject: Re: [Boost-users] asio: async ops in multithreading environment
From: Max Dmitrichenko (dmitrmax_at_[hidden])
Date: 2013-03-06 07:23:50


Hi Igor!

What do you mean by "use strands". I'm using strands for my completion
handlers. Also I can use strand to commit async operations and to post
close(). But that fact doesn't help given that the second buffer write
(from my scenario) is not initiated from within the same strand. It
seems that some internal boost strand is used to commit second and
later buffer writes when using scatter-gather async_write API. So the
question "how to safely close socket?" still remains.

2013/3/6 Igor R <boost.lists_at_[hidden]>:
>> The problem is: second write which is issued internally by boost
>> cannot be protected by the same mutex which is used for protected
>> access to the socket in my code.
>>
>> So, the question is: how can I safely close the socket?
>
>
> You should use strands:
> http://www.boost.org/doc/libs/1_53_0/doc/html/boost_asio/overview/core/strands.html
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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