CPP 1.3 NO IDEA Avatar
  1. OMG Issue

CPP13 — ref counting ambiguous?

  • Key: CPP13-34
  • Legacy Issue Number: 3339
  • Status: open  
  • Source: Triodia Technologies Pty Ltd ( Michi Henning)
  • Summary:

    For servant reference counting, the words "at least once" appear
    in a number of places when it comes to servant activation. set_servant(),
    activate_object(), activate_object_with_id(), servant_to_id(),
    servant_to_reference(), and _this() all use this language (pages 1-137 and
    1-138):

    ... will invoke _add_ref at least once on the Servant argument...

    Problem: suppose my ORB calls _add_ref() twice in each of these operations
    for some reason. I now have a problem. That's because, for servant
    activators, responsibility for calling _remove_ref() passes to
    etherialize(). However, if the ORB is permitted to call _add_ref() as
    many times as it likes, I have no idea how many times I have to call
    _remove_ref() from within etherealize(). I think that the spec should say
    that _add_ref() is called exactly once for these operations if the
    corresponding servant is not in the AOM already.

    I vaguely remember the discussion about optimization of the calls
    to _add_ref() and _remove_ref(). I think the idea was to permit the ORB
    to avoid redundant calls. However, it seems that the language in the spec
    isn't precise enough. Under one interpretation, the refcount counts
    the number of entries in the AOM. Under another interpretation, it counts
    the number of calls in progress as well (because an ORB could call _add_ref()
    when a call is dispatched and call _remove_ref() when it finishes).
    Under yet a third interpretation, the refcount counts the number of
    object references in my address space. That interpretation is happens
    if every call to _this() calls _add_ref()...

    The language is not precise enough, I think...

  • Reported: CPP 1.1 — Fri, 3 Mar 2000 05:00 GMT
  • Updated: Fri, 6 Mar 2015 20:57 GMT