C Files in the Tycoon System

The C files in the Tycoon System fulfill different purposes that are reflected in their position in the file system, in their naming and in the method they are linked to (and therefore called by) the Tycoon Language.

Tycoon Store

The Tycoon Store provides the persistence abstraction for the Tycoon System. Different stores show different characteristics, e.g. the memory store TYMEM is fast and simple, but needs much main memory (or swap space) while the single user store TYSIN implements his own swapping on files resulting also in fast restart and commit times.

The source files of the Tycoon Store are located in the directory ${TYCOON_ROOT}/tsp2 (the '2' indicates that there was a first version of the Tycoon Store). In this directory the different Tycoon Store implementations are located in subdirectories, e.g. the memory store in tymem and the single user store in tysin. There are also some general header files, e.g. tsp.h and tspmacros.h, and the generic intern/extern algorithm in tsplinio.c located here. The files implementing the Tycoon Store are all prefixed with tsp.

The derived object files are located in host dependent subdirectories. The actual used store implementation is linked symbolically to ${TYCOON_ROOT}/tsp2/${TYCOON_HOST}/libtsp.so. This path is wired into tmlink.c in the Tycoon Machine.

To call a TSP function from TL use the library name given by runtimeCore.tspLibraryName(). This name is recognized by the Tycoon Machine link mechanism in tmlink.c.

Tycoon Runtime System

The Tycoon Runtime System provides an abstraction layer above the underlying operating system. This layer should be used by the Tycoon Machine (maybe used in the future by the Tycoon Store) and the TL modules. Other modules of the Tycoon Store, the Tycoon Machine and the Tycoon Language (TL) should be as far as possible not depend on a specific operating system, i.e. libraries, to utilize ports to other machines or operating systems. All functions that can be used by TL are prefixed by DLLEXPORT. Some functions are bound statically to the Tycoon Machine in tmstatic.c.

The source files of the Tycoon Runtime System are located in the directory ${TYCOON_ROOT}/tm2 (together with the Tycoon Machine). The files are prefixed by rt.

The derived object files are located in host dependent subdirectories.

To call a runtime system function from TL use the library name given by runtimeCore.libraryName(). [## is this also correct for functions that are not bound statically in tmstatic.c???] This name is recognized by the Tycoon Machine link mechanism in tmlink.c.

Tycoon Machine

The Tycoon Machine is a byte code interpreter that respects the Tycoon Store Protocol to provide persistence. The byte code may call C functions by a the ccall mechanism. The C functions are linked to the Tycoon Machine by tmlink.c that distinguishes between TSP functions, Tycoon Machine (including runtime system and TL support) functions, auxiliary functions (see below) and operating system dependent functions. The link mechanism works transparently with statically and dynamically bound libraries.

There should be no references to store or machine dependent features in other C files. So ports and changes of the store or machine implementation can be localized here. But be aware that TL modules may bind to the store or machine functions that are marked by DLLEXPORT!

The source files of the Tycoon Machine are located in the directory ${TYCOON_ROOT}/tm2 (the '2' indicates that there was a first version of the Tycoon Machine). The files are prefixed by tm.

The derived object files are located in host dependent subdirectories.

To call a Tycoon Machine function from TL use the library name given by runtimeCore.libraryName(). [## is this also correct for functions that are not bound statically in tmstatic.c???] This name is recognized by the Tycoon Machine link mechanism in tmlink.c.

Tycoon Language Support

The Tycoon Language can bind to C functions by the ccall mechanism that is used via the module runtimeCore and the builtin function bind. By this mechanism TL modules bind to the functions of the Tycoon Store, Tycoon Runtime System, Tycoon Machine, auxiliary libraries and operating system dependent libraries. The resolution of the funcion call is performed by the Tycoon Machine in the module tmlink.c

While the Tycoon Machine implements the functionality of the byte code interpreter and the Runtime System abstracts from the operating system, the Tycoon Language needs other C functions to provide functionality that cannot be (sufficiently) expressed in TL. If this functionality does not depend on the Tycoon Store or Machine it should be located in auxiliary modules (see below). But if Tycoon Store/Machine specific functions are needed that are not provided by the Tycoon Store/Machine and that could not be placed in a Tycoon Store/Machine file, modules supporting the Tycoon Language should be written.

The source files of the Tycoon Language Support are located in the directory ${TYCOON_ROOT}/tm2 . The files are prefixed by tl. (Note that there may be also other files supporting other Tycoon languages, e.g. prefixed by tool for the TooL language.)

The derived object files are located in host dependent subdirectories.

To call a Tycoon Language Support function from TL use the library name given by runtimeCore.libraryName(). [## is this also correct for functions that are not bound statically in tmstatic.c???] This name is recognized by the Tycoon Machine link mechanism in tmlink.c.

Auxiliary files

Auxiliary files are located near the TL modules that bind to those C files because they need functionality that cannot be found in the Tycoon Store or Machine or other (dynamic) libraries. Auxiliary C modules should not depend on the Tycoon Store or Machine implementation, because ports and changes of Tycoon Store or Machine should not affect these modules. But they may depend on functionality of the underlying operating system, although this is not encouraged. Dependencies on the operating system, as far as they could be supported on many systems, but may be differ, should be located in the Tycoon Runtime System. Simple C functions or operating system resp. machine dependent functions may be placed in auxiliary C modules.

The derived object files are located in one host dependent subdirectory. The path of this directory is wired into tmlink.c.

To call a auxiliary function from TL use the library name given by runtimeCore.dynamicLibraryName(lib) where lib is the name of the auxiliary C module where the function is defined. This name is prefixed and so recognized by the Tycoon Machine link mechanism in tmlink.c.



Gerald Schröder (02-apr-1996). Your feedback is welcome.