ACCU Home page ACCU Conference Page
Search Contact us ACCU at Flickr ACCU at GitHib ACCU at Google+ ACCU at Facebook ACCU at Linked-in ACCU at Twitter Skip Navigation

pineditor << letters;

Overload Journal #33 - Aug 1999 + Letters to the Editor   Author: Aaron Ridout

Java Threads

In Overload 31 Allan Kelly presented an excellent article on using Templates to endow a UDT with a multi-threading capability. What I have found most useful so far to implement multi-threading, is to reuse the Java design of its Thread and Runable classes in C++. A UDT then inherits from Thread in order to endow the sub-class with the ability to multi-thread.

I'm not saying that the template method is better or not, just that the inheritance model may work in some (different) circumstances. I for one will probably consider which model to use in future thanks to Allan.

I would strongly recommend that all C++ programmers study (or practise some) Java and import the great design ideas that Java employs. I hope that one day the C++ standard library would include the best from the Java library.

I have also considered sub-classing Runnable into a Process class for a heavy weight ('fork/exec') processes, I.e. to launch an entire new application.

Overload Journal #33 - Aug 1999 + Letters to the Editor