Comment 3 for bug 541219

Revision history for this message
Jeff Hill (johill-lanl) wrote :

> So I open first thread, create CA context, create first CA
> channel. Then I open second thread, attach to current CA
> context, create second CA channel. ... Then I decide to
> close first CA channel and close context (???!!!). What
> is behavior CA library? I suppose second CA channel will
> be closed without normal procedure of closing
> second channel + its monitor?

The 2nd channel's subscription (monitor) is removed from the IOC, the channel is removed from the IOC, the circuit to the IOC is disconnected, and the channel is attached to a NOOP CA service.

> But I don't like to close second channel and CA context!
> Then I should check is that channel latest (is the
> last channel)? I couldn't find suitable function in CA
> function API.

There isn’t, currently, an interface for this information in the library.

> I have once way - hold tracks of my CA channels (minimum
> is global counter). Usually it could be done. But if program
> is mixture of different libraries and each library comes to
> CA library then it becomes impossible.

No such interfaces (for attaching and incrementing an in use count and detaching and decrementing an in use count) currently exist. I will add your ideas to Mantis entry 161 (initiated on behalf of Ben) for further consideration.

> But if program is mixture of different libraries and
> each library comes to CA library then it becomes impossible.

One would need to carefully consider if these independent libraries should share a CA context. If so, perhaps you might pass a CA context identifier to these libraries when they initialize.