|
Boost : |
From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-08-27 20:30:37
--- "E. Gladyshev" <egladysh_at_[hidden]> wrote:
> --- Andreas Huber <ah2003_at_[hidden]> wrote:
> > No I haven't, but then again to my knowledge no real-time folks are using
> > the library yet. The project I was involved in was doing just fine with
> > replacing global new/delete. The co-workers with more experience in the
> > real-time field convinced me that a library without separate memory
> > management customization capabilities is just plain useless for some
> > applications. E.g. as Eugene explained, someone might need to allocate the
> > data of some (not all) FSMs on a separate heap (e.g. non-volatile memory),
> > so that state can be preserved if power is lost. The machine can then
> > continue where it left off when power returns.
>
> There is another reason for specializing allocations to multiple heaps.
> If you are working on fault-tolerant system, you have to have a separate
> heap for fault/exception handling.
> If you program crashes, the state of the main heap may become unpredictable
> what is often the case.
> It is a general practice to create a protected heap just for exception handling.
> BTW: it is true even for desktop application. Many good books on debugging
> discussed this technique.
>
> I am actually using a separate heap in my general purpose exception handler.
> My exception handler is quite complex, it creates a log, compresses it, etc.
> The nice thing about it that I can still use STL containers
> while processing exceptions. All I had to do is to implement a protected
> allocator. I had to write a simple smart pointer for my handler
> to work around Boost limitations. Basically in my handler,
> I could use almost nothing from Boost except
> the Metaprogramming stuff.
>
> Eugene
>
Sorry, I forgot to remove Peter Dimov names for the header.
The above reply was to Andreas.
BTW: I am not a Microsoft fun, but I was impressed with them
when I was working on the compression part of my handler.
Their C-style CAB SDK thoughtfully provides a way to define
custom memory and file managers. So I didn't have
to do much to add some powerful features to my handler.
Eugene
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk