Re: Exception Misconceptions: Exceptions are for unrecoverable errors.
In article <hh3dco$osh$1@news.albasani.net>, Branimir Maksimovic <bmaxa@hotmail.com> wrote:
James Kanze wrote:
On Dec 24, 10:11 am, Branimir Maksimovic <bm...@hotmail.com> wrote:
tanix wrote:
In article <hguelj$k4...@news.albasani.net>, Branimir Maksimovic
<bm...@hotmail.com> wrote:
[...]
Memory managment is not a problem. You can implement GC, for
any apllication even in assembler. Reference counting is
simple form of gc and works well in c++ because of RAII.
Reference counting doesn't work in C++, because of cycles. And
reference counting is very, very slow compared to the better
garbage collector algorithms.
Hm, have you ever head cycles? In my long experience I never
had cyclic references...
Reference counting can;t be slow because it does not have
to lock all threads, neither is incrementing decrementing
variable slow in comparison with complete memory scan every time
gc have to chase pointeras through cyclic graph inside
application. No matter what you do , it is impossible
to make it faster than refcounting...
Looks like it is a matter of life and death to you.
But I doubt you can win this argument.
[...]
And somebodey tried to convince me that conservative GC is
faster that shared_ptr/auto_ptr (what a ....;)
And you refused to even look at actual measurements. I'm aware
of a couple of programs where the Boehm collector significantly
out performs boost::shared_ptr. (Of course, I'm also aware of
cases where it doesn't. There is no global perfect solution.)
Hm, how can possibly complex algorithm outperform simple
reference counting. Try to measure deallocation speed.
Allocation in GC is same as manual allocation. But
deallocation is where it performs complex algorithm.
And so it goes "till your nose goes blue"...
:--}
Greets
--
Programmer's Goldmine collections:
http://preciseinfo.org
Tens of thousands of code examples and expert discussions on
C++, MFC, VC, ATL, STL, templates, Java, Python, Javascript,
organized by major topics of language, tools, methods, techniques.