|
|
|
|||||
|
A Question about Shared and GCShared
hi, there,
There are two base class in ICE , Shared and GCShared. But I do not know what is the difference between them . Which should I use and in what circumstance to use ? Are there any generic principles in practice? Any help is appreciated. Best regards OrNot |
|
|||||
|
hi,marc,
Do you mean that GCShared should be transparent to application programmer? But in fact, I did not realize the GCShared until I studied the bidir demo and noticed the following comments in callbackI.h file: ----------------------------------------------------------- We cannot derive CallbackSenderI from IceUtil::Thread, because CallbackSenderI uses IceUtil::GCShared as base, and IceUtil::Thread uses IceUtil::Shared as base. These two base classes are not compatible. Therefore we use this helper class. ----------------------------------------------------------- I think if it were me to program this demo, I would much probably derive the callbacksenderI from the IceUtil::Thread because I never get any knowledge from docoument about GCShared and Shared. But so far as this demo, it seems not transparent to us application programer. BTW: Another elementary question (sorry, I have too many newbie quesitions.)When introducing the Bi-directional Connections , In 33.7, it is said that "An Ice connection normally allows requests to flow in only one direction." But I can't understand why say so since ,say, a TCP connection, is duplex. Or the "uni-direction" mentioned here just is imposed by ICE ? Hope getting your help. Thanks a lot. OrNot |
|
||||||
|
You are right in that we need to better document that you cannot derive an implementation class from IceUtil::Shared (directly or indirectly). But I don't see any transparency issue here, except for those that every intrusive reference counting scheme imposes. If you would have any other base class for intrusive reference counted objects, such as from a third-party library, then you couldn't derive from this base class either.
Regarding your other questions, of course TCP connections are bi-directional. However, if with Ice you want to use a connection both for sending and receiving requests, then you have to take the extra steps as outlined in the bi-dir demo, or you must use a router such as Glacier. Last edited by marc : 06-23-2005 at 12:05 AM. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| resource disposal in shared servant | programmerdad | Help Center | 3 | 08-01-2006 07:05 PM |
| can i create servant instance from shared library?help! | lanbo | Help Center | 10 | 02-24-2005 08:27 AM |
| shared my Slice2CppTask source code with u! | lanbo | Comments | 1 | 01-04-2005 08:03 PM |
| Assertion failure in GCShared in 1.3? | brian | Help Center | 9 | 03-24-2004 12:14 AM |