Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-07-2003
greg_hall greg_hall is offline
Registered User
 
 
Join Date: May 2003
Location: Brisbane, Australia
Posts: 2
Documentation re: stack-allocated servants

Version 1.0.2 of the Ice documentation states in "10.7.1 Instantiating a Servant":

"Instantiating a servant means to allocate an instance, either on the stack or on the heap. Most commonly, servants are instantiated on the heap because we want the servant instance to endure beyond the duration of the current stack frame:"

This is rather misleading in practical terms in the light of the section, "Stack-Allocated Class Instances" in "6.14.5 Smart Pointers for Classes" which states:

"...allocating class instances on the stack is pragmatically useless because all the Ice APIs expect parameters that are smart pointers..."

and goes on to demonstrate the dangers of using stack-allocated classes with smart pointers.

Wouldn't it be better to state in 10.7.1 that servants *must* be allocated on the heap (as with the later CORBA specs) or provide a cross-ref to the appropriate part of 6.14.5? Or can a sensible example of stack-allocated servants be provided in the documentation?

Cheers,

Greg

BTW, a few of the cross-references seem to be broken in 10.7.2-3
Reply With Quote
  #2 (permalink)  
Old 05-07-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Re: Documentation re: stack-allocated servants

Quote:
Originally posted by greg_hall
Version 1.0.2 of the Ice documentation states in "10.7.1 Instantiating a Servant":

"Instantiating a servant means to allocate an instance, either on the stack or on the heap. Most commonly, servants are instantiated on the heap because we want the servant instance to endure beyond the duration of the current stack frame:"

This is rather misleading in practical terms in the light of the section, "Stack-Allocated Class Instances" in "6.14.5 Smart Pointers for Classes" which states:

"...allocating class instances on the stack is pragmatically useless because all the Ice APIs expect parameters that are smart pointers..."

and goes on to demonstrate the dangers of using stack-allocated classes with smart pointers.

Wouldn't it be better to state in 10.7.1 that servants *must* be allocated on the heap (as with the later CORBA specs) or provide a cross-ref to the appropriate part of 6.14.5? Or can a sensible example of stack-allocated servants be provided in the documentation?

Cheers,

Greg

BTW, a few of the cross-references seem to be broken in 10.7.2-3
Hi Greg! (Long time no talk )

You caught me out there.

Yes, you are right -- allocating servants on the stack is something that's fraught with danger and best not done at all. I'll fix this for the next version of the doc, thanks!

I'll have a look at the broken XREF. Do you have a page number?

Thanks,

Michi.
Reply With Quote
  #3 (permalink)  
Old 05-07-2003
dhalbert dhalbert is offline
Registered User
 
 
Join Date: Feb 2003
Location: Massachusetts
Posts: 2
Quote:
I'll have a look at the broken XREF. Do you have a page number?
Michi,

You can find them all systematically by doing a search for "XREF" in the 1.0.2 .pdf file (use Acrobat Reader Edit->Find, its binoculars icon, etc.). Quite a few show up.

Regards,
Dan
Reply With Quote
  #4 (permalink)  
Old 05-07-2003
greg_hall greg_hall is offline
Registered User
 
 
Join Date: May 2003
Location: Brisbane, Australia
Posts: 2
Quote:
I'll have a look at the broken XREF. Do you have a page number?
I found them on pages 245 and 247-49.

HTH,

Greg
Reply With Quote
  #5 (permalink)  
Old 05-08-2003
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Quote:
Originally posted by dhalbert
Michi,

You can find them all systematically by doing a search for "XREF" in the 1.0.2 .pdf file (use Acrobat Reader Edit->Find, its binoculars icon, etc.). Quite a few show up.

Regards,
Dan
Ah, OK, misunderstanding. These cross references are in the text deliberately. They point at things that we intended to refer to at that point, but the text they refer to hasn't been written yet. So, these XREF markers will be progressively resolved as we add more material.

Cheers,

Michi.
Reply With Quote
  #6 (permalink)  
Old 05-08-2003
bolidecaster bolidecaster is offline
Registered User
 
 
Join Date: May 2003
Posts: 4
Those XREF markers confused me as well. Thanks for clarifing that.
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
Proxy from Servants and vicecersa. EmmanuelOga Help Center 1 08-02-2006 01:54 PM
dumpdb overflows stack acbell Bug Reports 2 07-31-2006 12:43 PM
Documentation ChrisC Comments 7 09-16-2005 09:31 AM
Multiple threads smashing the stack Ric Help Center 8 06-09-2005 12:55 PM
Documentation for Default Servants example andreynech Bug Reports 2 09-24-2003 07:59 AM


All times are GMT -4. The time now is 12:42 PM.


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.