logo       

Re: undelivered handlers: msg#00001

lib.boost.asio.user

Subject: Re: undelivered handlers

Hi Pavel,

Pavel Kalugin <p.kalugin-Re5JQEeQqe8AvxtiuMwx3w@xxxxxxxxxxxxxxxx> wrote:
> Is it safe, in the sense of resource leakage, to post handlers
> through io_service after io_service::run() has completed, or
> even not called? In other words, is there guarantee that all
> resources, associated with io_service processing is freed upon
> its destruction? Are destructors for undelivered hadlers
> called?

Yes, all copies of undelivered handlers are destroyed when the
io_service destructor is called. You just need to make sure that
any resources that may be associated with the handlers are
destroyed. Using shared_ptr/enable_shared_from_this as the
tutorials do will take care of this.

> I assume it is, but the docs is not clear about this, and
> there is some issues related to io_service::interrupt(), which
> description says: "... In this case an io_service
> implementation is not required to make any guarantee that the
> resources associated with unfinished work will be cleaned up."
> - even after io_service destruction?

Oops, yes that used to be the case, but it's no longer right. I
should remove that comment. Thanks for pointing that out.

Cheers,
Chris



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise