Re: [Fresco-devel] Graphic_var's and server stability

Nick Lewycky <[email protected]>
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
Neil Pilgrim wrote:

[snip excellent point-by-point analysis]

> Is this a correct analysis? If so I think it would be useful, in
> addition to a coding style-guide, to have a 'corba style guide' or
> similar, maybe in a FAQ style, with gotchas like the above. Perhaps I've
> just not read H&V cover-to-cover enough, but although a problem like
> this is hinted-at, its not made explicit? 

That's exactly what Stefan taught me. Not casting it to an _var type 
will cause you to leak. It should really be documented in big neon 
lights all over the place. But since we can't do that, I guess the style 
guide, faq, tutorial, code examples, synopsis generated documentation, 
website, wiki, mailing list and issue tracker will have to do. ;-)

> If I got the above correct, what I'm also concerned with is the way that
> a client could easily be (badly) written such that it leaks
> graphic-references. When this client exits, will all the graphics that
> it requested be deleted? I believe that would be desirable; even if we
> want to keep some graphics from the client, they could be copied before
> the client quit, but I'm not sure if this would remove the benefits of
> deleting the original graphics.

I think it will, because we have a per-client POAs and the object will 
be created in the appropriate POA. That POA gets destructed on client 
exit. Or something like that. It's written in the ServerContextImpl 
"this is the thing which holds all the references to things a client 
allocates (for garbage collection)". [Or I could be mistaken and objects 
are allocated per-kit, which would mean that the object is in the 
LayoutKit and won't be unallocated until *its* destruction. That would 
indeed be a problem.]

But the fact that a program can be written to leak so easily bothers me 
too. Why can't the compiler be made to catch this? Well, that would be a 
change to CORBA which we aren't really in a position to make. Or why 
does it return a Graphic_ptr type instead of a Graphic_var? Does it matter?

Nick Lewycky
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.