Home Page -------------------
[Home Page] - [Reviews Main]
-------------------

Book Review
Garbage Collection by Richard Jones & Rafael Lins
Recommended
ISBN: 0-471-94148-4       Publisher: Wiley       Pages: 377 pages       Price: £29-95
Categories:   advanced c++    
Reviewed by Francis Glassborow in C Vu 8-6 (Sep 1996)
Garbage collection is the term used to refer to a class of techniques for handling the recovery of dynamically allocated memory. The idea is that the executable/run time system keeps track of dynamically allocated memory and at some time after the last handle (pointer, reference) to that memory has gone from the program a garbage collector will recover the memory. What it means is that the programmer is only responsible for allocation all else is the responsibility of the compiler and other tools. GC is essential for some programming paradigms, desirable for others and detrimental to some. It is the existence of that last group that led to C++defaulting to non- GC .

Even more important is that there are at least three pure GC strategies, reference counting, mark and sweep, and copy and compact. Each has definite strengths and weaknesses. Languages such as Smalltalk have selected a strategy and, as a programmer, you have to live with it (it may even vary from compiler to compiler which can have significant implications).

There is nothing in C++ (nor in C) that prohibits the use of GC and there are third party libraries that provide GC for C++ (there is also a conservative GC available for C, though it is harder to provide such facilities for that language). It is also perfectly allowable for a C++ compiler to provide GC support.

At the Stockholm meeting of WG21/X3J16 there was a paper from Bjarne Stroustrup on the subject of garbage collection. The motivation for the paper was to try to build into the language a hint that GC could be made available in C++. In the event the suggestions were voted out, mainly, I suspect, because they did not actually do anything except propose a macro that would allow a program to check if a compiler was working in GC mode. Most of those present were already completely aware that C++can support GC and therefore saw the macro as one more unnecessary application of the pre-processor (I know this is an over simplification but this is not the place to get into all the technical detail).

How much do you know about garbage collection? Certainly in the early days it was one of those processes that real time programmers avoided like the plague because it periodically brought their program to a juddering halt while the garbage collector recovered memory resources. These days GC has become much more sophisticated with a multitude of algorithms.

If you want to know about the principles, perhaps because you have an ambition to write a garbage collecting library for C++ (you have to replace operator new and operator delete) then this is an excellent place to start. In fact there are many places where a programmer wishes to manage memory allocated to some process where a sound knowledge of GC algorithms will save many wasted hours.

One early place where you might like to experiment with garbage collection is by providing it for managing the memory requirements of a single class via overloaded versions of new and delete. Definitely getting into expert territory but it would make a good series for Overload.

Those interested in management of (dynamic) memory should read this book. To the best of my knowledge there are no competitors.


Other Authors with the same surname

Jones
Fundamentals of Object-Oriented Design in UML by Meilir Page-Jones [Recommended]  (Reviewed Jul 2000)
Graphics Programming PowerPack by Michael Jones  (Reviewed May 1993)
Office 97 Bible by Jones & Sutton  (Reviewed May 1997)
Patterns of Software Systems Failure and Success by Capers Jones  (Reviewed May 1998)
Software Assessments, Benchmarks, and Best practices by Capers Jones [Recommended with Reservations]  (Reviewed Dec 2000)
Teach Yourself Advanced C in 21 Days by G L Guntle & B L Jones  (Reviewed Nov 1994)
Teach Yourself C Programming in 21 Days by Peter Aitkin & Bradley Jones [Recommended]  (Reviewed Mar 1997)
Teach Yourself C in 21 Days (5ed) (with Visual C++ 6.0) by Aitkin & Jones [Not Recommended]  (Reviewed Sep 2000)
Teach Yourself C in 21 Days Complete Compiler Edition by Peter Aitkin & Bradley Jones  (Reviewed May 1998)
Teach Yourself C in 21 Days by Peter Aitkin & Bradley Jones  (Reviewed May 1994)
Teach yourself Microsoft Word 97 in 24 hours by R T Herandez & L Jones  (Reviewed Mar 1998)
Web Programming with Java by Michael Girdley & Katheryn A Jones  (Reviewed Sep 1997)
Year 2000 Software Problem, The by Capers Jones  (Reviewed Jan 1999)


Last Update - 13 May 2001.

To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/g/g000560.htm

Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.

Mirrored from http://www.accu.org/