Wednesday, August 10, 2005
Wise Pointers in C++
In 1998, while preparing the slides for an advanced course in C++, I envisioned a different kind of reference-counted smart pointer, which ought to be significantly faster than the then-existing alternatives. I called them "Wise Pointers" because they were... wiser :-) than the average smart pointer :-).
The subject seemed a little too advanced :-) for the course and didn't make it into the slides: actually, I never took the time to implement the concept and try it out. I guess I forgot about it shortly after; that's the problem of having too many ideas and too little time :-).
A few months ago, I read an interesting paper on the distribution of incoming and outgoing references in Java and C++ programs ("Scale-Free Geometry in OO Programs", by Alex Potanin, James Nobile, Marcus Frean and Robert Biddle, Communications of ACM, May 2005). It reminded me of the wise pointers idea, indeed providing an experimental background for the usefulness of the concept. Still, somehow I put the idea on hold and again forgot about it.
Today, I was reviewing my slides on template metaprogramming, as part of the customization of an advanced C++ course for embedded / real-time programming. The idea popped out again, and this time I didn't send it back. I did a reasonably thorough check and it seems like nobody has came up with something similar in the past 7 years :-), so it's time for me to write some code, try it out, and if it works as well as I think it will, write a short article about it (yes, full source code will be included :-)).
The subject seemed a little too advanced :-) for the course and didn't make it into the slides: actually, I never took the time to implement the concept and try it out. I guess I forgot about it shortly after; that's the problem of having too many ideas and too little time :-).
A few months ago, I read an interesting paper on the distribution of incoming and outgoing references in Java and C++ programs ("Scale-Free Geometry in OO Programs", by Alex Potanin, James Nobile, Marcus Frean and Robert Biddle, Communications of ACM, May 2005). It reminded me of the wise pointers idea, indeed providing an experimental background for the usefulness of the concept. Still, somehow I put the idea on hold and again forgot about it.
Today, I was reviewing my slides on template metaprogramming, as part of the customization of an advanced C++ course for embedded / real-time programming. The idea popped out again, and this time I didn't send it back. I did a reasonably thorough check and it seems like nobody has came up with something similar in the past 7 years :-), so it's time for me to write some code, try it out, and if it works as well as I think it will, write a short article about it (yes, full source code will be included :-)).




