Boost logo

Boost :

From: Christopher Kohlhoff (chris_at_[hidden])
Date: 2006-02-09 08:31:13


Hi Felipe,

--- Felipe Magno de Almeida <felipe.m.almeida_at_[hidden]> wrote:
> Is there any ready example about alternative styles without
> shared_ptr overhead? I'm very curious about how it is possible
> (without cluttering the code).

Not as yet, sorry.

I'm planning to write an example where all objects are created
up front, including buffer space for custom handler allocation.
For example, one can imagine a server where a configuration file
specifies the maximum number of concurrent connections that will
be allowed. Once the server is up and running there will be no
ongoing memory allocation.

The motivations for using this approach would include
performance, robustness, and eliminating heap fragmentation in
what might be a very long running process.

Since all the application objects would have a lifetime that
spans the call to demuxer::run(), you could simply pass plain
pointers around to your handlers.

Cheers,
Chris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk