Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 06-22-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 156
Send a message via MSN to OrNot
-->
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
Reply With Quote
  #2 (permalink)  
Old 06-22-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
GCShared can detect cyclic references, and therefore do garbage collection. It is not intended to be used by the application programmer, because it also requires generated code to function properly.
Reply With Quote
  #3 (permalink)  
Old 06-22-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 156
Send a message via MSN to 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
Reply With Quote
  #4 (permalink)  
Old 06-23-2005
marc's Avatar
marc marc is online now
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT -4. The time now is 08:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.