User Tools

Site Tools


dictionary_class.htm
Navigation:  Advanced Topics >====== Dictionary Class ====== Previous pageReturn to chapter overviewNext page

The Clarion threading model dictates that the existing File and Relation Managers use threaded objects (i.e. a new instance on every thread).

One of the effects of this is that the traditional ABC code that initializes both File and Relation Managers (contained in the DctInit generated procedure) now has to be executed whenever a new thread is started. Likewise, the Managers' kill code (traditionally contained in DctKill) must be called whenever a thread is terminated.

To facilitate this, a small globally defined class called Dictionary will be generated into every ABC template based application that does not have its global data defined external to the application. (i.e. the File and Relation managers compiled locally). The Dictionary object contains only construct and destruct methods but, more important, it is a threaded object.

Example:

Dictionary  CLASS,THREAD

Construct    PROCEDURE

Destruct     PROCEDURE

           END

Dictionary.Construct PROCEDURE

CODE

DctInit()

Dictionary.Destruct PROCEDURE

 CODE

 DctKill()

This means that the Construct method will be called whenever a new thread comes into existence and the Destruct method will be called whenever a thread is terminated. The constructor calls DctInit and the destructor calls DctKill. Therefore, DctInit is called whenever a thread is started and DctKill is now called whenever a thread is terminated; thus ensuring that threaded File and Relation managers are created and destroyed correctly.

dictionary_class.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1