RTC 1.0 NO IDEA Avatar
  1. OMG Issue

RTC — ComponentAction callbacks argument

  • Key: RTC-17
  • Legacy Issue Number: 10495
  • Status: closed  
  • Source: AIST ( Dr. Noriaki Ando)
  • Summary:

    Source: AIST (Noriaki Ando, [[MailTo(n-ando AT SPAMFREE aist DOT go DOT jp)]])

    Severity: Minor

    Disposition: Resolution Proposed

    Summary

    ComponentAction callbacks (on_startup, on_shutdown, on_activate, on_deactivate, on_aborting, on_error, on_reset) receive ExecutionContext as argument. In CORBA IDL PSM, this is directly described as follows.

    interface ComponentAction {
    :
    ReturnCode_t on_activated(in ExecutionContext exec_context);
    :
    };

    However, these operations only use the given context as monicker to know which ExecutionContext is calling the operation. Since the cost of an operation call giving a pointer as an argument may be low, ExecutionContext's pointer is one of better moniker of the ExecutionContext, in local mapping. In CORBA, however, giving object reference as a moniker of ExecutionContext costs very high. Especially, if DataFlowParticipant's on_execute operation would be called in real-time loop, very heavy servant side object reference creation would happen in each period. These operations only need moniker to identify the ExecutionContext, and the moniker would be PSM dependent matter.

    – Noriaki Ando, 2006/12/4

    Discussion

    Resolution

    I'd like to propose the following CORBA IDL.

    interface ComponentAction

    { UniqueIdentifier attach_executioncontext(in ExecutionContext exec_context); ReturnCode_t detach_executioncontext(in UniqueIdentifier ec_id); ReturnCode_t on_initialize(); ReturnCode_t on_finalize(); ReturnCode_t on_startup(in UniqueIdentifier ec_id); ReturnCode_t on_shutdown(in UniqueIdentifier ec_id); ReturnCode_t on_activated(in UniqueIdentifier ec_id); ReturnCode_t on_deactivated(in UniqueIdentifier ec_id); ReturnCode_t on_aborting(in UniqueIdentifier ec_id); ReturnCode_t on_error(in UniqueIdentifier ec_id); ReturnCode_t on_reset(in UniqueIdentifier ec_id); }

    ;

    In ExecutionContextAdmin::add, attach_executioncontext would be called. ExecutionContext that calls ComponentAction's callback is notified by using attach_executioncontext and it returns a unique identifier (it may be unique only in the ComponentAction).

    – Noriaki Ando, 2006/12/4

    I like the proposal. Because of the dependencies between RTC and SDO, the definition of UniqueIdentifier cannot be reused from SDO. But there is a useful pattern for this situation in the DDS specification:

    #define UNIQUE_ID_TYPE_NATIVE long
    module RTC

    { typedef UNIQUE_ID_NATIVE UniqueId; // ... }

    ;

    The meaning is that the representation of the UniqueId type is outside of the RTC module, so implementations are free to choose their own. Implementations built on top of SDO can use:

    #define UNIQUE_ID_TYPE_NATIVE SDO::UniqueIdentifier

    ...but other implementations can choose something else. – RickWarren, 2006/12/4

    Revised Text

  • Reported: RTC 1.0b1 — Tue, 5 Dec 2006 05:00 GMT
  • Disposition: Resolved — RTC 1.0
  • Disposition Summary:

    Define an ID to represent an execution context in the callbacks. Provide operations to map between the ID and the object reference for callback implementations that require that information.
    A resolution for this issue can be combined with the resolution of issue 10496.
    Disposition: See issue 10496 for disposition

  • Updated: Fri, 6 Mar 2015 20:58 GMT