Journal Articles

Overload Journal #33 - Aug 1999 + Letters to the Editor
Browse in : All > Journals > Overload > 33 (8)
All > Journal Columns > LettersEditor (132)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: editor << letters;

Author: Administrator

Date: 26 August 1999 17:50:54 +01:00 or Thu, 26 August 1999 17:50:54 +01:00

Summary: 

Body: 

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.

Notes: 

More fields may be available via dynamicdata ..