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

Neil Pilgrim <[email protected]>
Newsgroups gmane.comp.video.fresco.devel
Message-ID <[email protected]>
Stefan Seefeld wrote:
> Neil Pilgrim wrote:
[...]
> > - an unreleasable reference leads to the Graphic in the server (ie.
> > vfill) not being unallocated when it is no longer required, since there
> > will always be one client-side reference.
> 
> that's not true in general. It is true if you use distributed ref counting
> (as we do), where the lifetime of proxies is coupled to the lifetime of
> servants (using the right smart pointers, of course).

OK, I was getting worried that I had half the idea wrong until this
point.

Thanks for the analysis; I already understood the first part, ie. that
you should always release Foo_ptr's returned from corba calls, but
didn't think (doh) about how it would fit into 'nested' calls.

> > 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?
> 
> I totally agree, this whole issue can't be stressed enough. I'v started
> to cover it in the tutorial at http://www2.fresco.org/tutorial/index.html
> (Appendix B), and everybody is welcome to comment on that (and even enhance
> it !)

For some reason I thought of the tutorial as an architectural
introduction, but of course its a programming one too :) BTW, we'll need
an update as and when resolve_server is used wrt the nameserver not
being mandatory, etc. Maybe it might be worth having somewhere to list
extra parts to the tutorial that need adding, like this? A task perhaps?
(we could use the wiki, but a task gives more of a way to say when we're
completed, which would be useful IMO)

TBH something like this is maybe more important than just an appendix:
to introduce people to programming in fresco, we need to teach them
corba first, without putting them off too much. Then again, people
should read *all* the docs ;)

> > 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.
> 
> yes, all resources allocated by the client will be released when the client
> disconnects, no matter how. That's indeed crucial.

Doh! Yes, of course, I knew that this was the case, but didn't associate
it with the leaking-reference problem! POA's are good :)

Thanks Stefan,

-- 
Neil
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.