Boost logo

Boost Users :

Subject: Re: [Boost-users] ASIO cancel question
From: Igor R (boost.lists_at_[hidden])
Date: 2009-08-07 08:44:45


1, 2) IIRC, the answer is no - i.e. even if your io_service is running
in a single thread, you can't be sure that an attempt to cancel i/o
operation or timer will really have any effect, because the operation
can already be complete so that cancellation won't affect it, and even
more than that -- its handler can already be in the queue. I remember
there is a discussion on this topic somewhere, but I can't find it at
the moment.

3) It seems that in the current implementation your assumption is
correct, i.e. the handlers are processed as "fifo", but I agree with
Roman that it's not a good idea to rely on such an undocumented and
implementation-dependant behaviour. It's better to make your own queue
or to organize the things as "request-handler-request..."


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