-
Notifications
You must be signed in to change notification settings - Fork 1
Ebb Object Model
Ebbs are the primary programming model for EbbRT. An Ebb appears as a standard C++ object on which you can call methods (e.g., food->bar()
), however, Ebbs are unique, in part, in that they are designed abstract the distributed nature of the underlying object implementation.
The EbbRef template, templated by a compatible object type, T, creates a reference to an Ebb, through which the object can be interacted with. By definition, the minimal requirement of an Ebb compatible object is that it supports lazily instantiation. This is establish through the definition of an HandleFault(EbbID id)
method and enforced at compile time (through the EbbRef template definition).
Each Ebb reference corresponds with an EbbID. EbbIDs are not necessarily unique as they maybe part of a local or global namespace. A small list of statically define EbbIDs, along with EbbRef template definition are located in trans.hpp
auto event_manager = EbbRef<EventManager>(event_mananger_id)
The above line creates a new EventManager
Ebb reference, event_manager
, that is bound to the ID event_manager_id
. Although the reference to the EventManger
Ebb now exists, the object itself remains uninstantiated.
Ebb objects are allocated and initialized lazily, i.e., only on the first reference to the object. A local translation table acts as a cache of Ebb objects (identified by the corresponding EbbIDs) that have been initialized locally.
1) Create an Ebb reference
auto fooref = EbbRef<FooObj>(foo_id);
The fooref
reference can now be used to make FooObj
calls.
2) Make an Ebb call
fooref->bar();
Contained within the EbbRef type is the cache offset, based off the EbbID, within the local translation cache. Upon dereference, the local cache is queried for a valid object location. If the cache is 'hit', the location is returned and the method is resolved. In the case of a cache 'miss' the templated object's HandleFault()
method is called.
Optional expanded Ebb functionality are provided through templates.
- multicore_ebb_static Defined a multicore (locally distributed) Ebb that is assigned a static (unchanging) ID.