Subject: Re: [boost] [asio] Mixing of sync and async calls
From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2009-09-19 19:04:26
On Thu, 17 Sep 2009 09:11 +0200, "Roland Schwarz"
> Is it legal to mix async and sync function calls?
> (I was not able to find the answer in the doc.)
Yes. Some examples use this (e.g. porthopper).
Do make sure you respect the documented thread safety requirements
though (i.e. don't do the above function calls concurrently).
> Also when in a blocking sync call, will it be
> possible to "cancel" it from another thread,
> e.g. by posting to the io_service which will
> invoke a close on the socket?
No. Only async calls can be portably cancelled.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk