
Hi Simon, Just to clarify... --- simon meiklejohn <simon@simonmeiklejohn.com> wrote:
Guarantees about how a task will execute may not matter to all applications but it critical to others. The asio::demuxer gives a guarantee that the task will execute in a thread that has called demuxer::run, which may include the thread which is doing the requesting - implication being that the call may take place immediately.
Immediate execution can only occur if demuxer::dispatch() is used.
This is an excellent performance optimisation, but the programmer may require stronger guarantees, perhaps against that very optimisation.
Hence the distinction between demuxer::dispatch() which allows the optimisation, and demuxer::post() which does not. The decision about which is appropriate needs to be made at the point where the function object is invoked, so the two functions are provided. Cheers, Chris