• Quick Start
  • Booting
  • Platform
  • Portals
  • References
    • API Reference TOI3
    • IIP Reference
  • Resources
ARRIS Enterprises, Inc. Confidential Information

Design Principles

Event Driven

KreaTvGfx does not use its own thread, it is designed around a single central event loop which allows for elegant event driven programming. An interface pointer to an event loop should be passed to the create-functions for the library.

The idea with an event loop is that the process stays passive until an event occurs; basically that a file descriptor suddenly becomes possible to read from or write to, or a timeout occurs. An implementation of the event loop interface is available in the KreaTV SDK. The C++ class called TUnixEventLoop implements its magic using the standard Unix poll() system call. It is also possible to use a custom implementation of the event loop interface, e.g. an adapter to an existing event loop mechanism.

Thread Safety

By default, non of the libraries are thread safe, this means that the user must make sure not to make calls from multiple threads at the same time.

It is possible to configure KreaTvGfx to either run in thread-safe fashion, or issue log error messages and abort if it is accessed by more than a single thread at a time. See KreaTvGfx Configuration for more information.

KreaTvGfx thread-safe mode adds protection against undesired internal KreaTvGfx data modification, and guards IPC from multi-threaded access. However it does not guarantee that the order of execution is kept unchanged, comparing to single-threaded operation (e.g. API method may be called during observer method execution), and does not protect getters from retrieving intermediate data.

Re-entrancy

No calls to KreaTvGfx should generate callbacks to any of the observer interfaces, i.e. no re-entrant calls are made by any of the libraries. Calls to observer interfaces are only done when the event loop is running. This is important so the user of the library can be sure no strange changes of its own data occurs because of calling a function.

Reference Counting

When getting and creating objects that implement the different interfaces of the library, boost smart pointers are used to automatically do reference counting. No objects are created using the standard C++ new operator and no objects should be destroyed using the standard C++ delete operator.

Reference counting makes the libraries more convenient to use and minimizes the risk for memory leaks.

5.0.1

Copyright (c) 2016 ARRIS Enterprises, LLC. All Rights Reserved. ARRIS Enterprises, LLC. Confidential Information.