Static functions & variables in ObjecTime

Category |  Purpose |  Intended Audience |  Applicable to |  Description |  Limitations |  See also


Category:

Top

C++


Applicable to:

Top

All Versions


Purpose:

Top

To discuss issues related to the usage of static functions and variables in ObjecTime models


Intended Audience:

Top

C++ users


Description:

Top

There are a number of problems with static functions and variables from an ObjecTime perspective:

  1. Statics are intraprocess-global, but invalid (inaccessible) interprocess. The basic ROOM semantics are supposed to be without distribution constraints; but if there are intraprocess globals around, this restricts those actors and data elements that access them to be in the same process, and perhaps most importantly, does so invisibly (i.e. they create an implicit coupling).
     
  2. Statics are in general not safe in a multi-tasking environment

The main use for these things appears to be as a mechanism for RPC call-backs that circumvent some of ObjecTime's current limitations with respect to the external layer service.

Some C++ users like them because they're used to them in 'normal' C++ development in a single process environment, but there is a potentially high price for this when their models break because of the lack of re-entrancy or invalid accesses. As ObjecTime increasingly moves towards model validation, these sorts of things will introduce invisible holes into the analysis and could cause problems.

So, in general, users are recommended to avoid using statics in their models at this time.


Limitations:

Top

None


See also:

Top

None


 

Copyright © 1999, ObjecTime Limited.