[haiku-gsoc] Re: WIP interface archiving patch

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-gsoc@xxxxxxxxxxxxx
  • Date: Sat, 12 Jun 2010 13:47:14 +0200

On 2010-06-12 at 12:11:55 [+0200], Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> 
wrote:
> Ingo Weinhold <ingo_weinhold@xxxxxx> wrote:
> > > A similar problem is software that already calls the unmanaged
> > > version
> > > of Archive() / Instantiate().
> > Should both work the same way: create a manager and delegate to the
> > managed
> > method.
> > 
> > The main issue I see is that creating and destroying a manager for
> > each
> > object is quite a bit of overhead for old software.
> 
> Can we use thread local storage, and create a manager if none is there
> yet, and use it when it's there? The view that created it would then
> remove it when it's done unarchiving.

That doesn't work, since it would no longer allow to discriminate between 
old style archiving -- i.e. archive children in a child message -- and new 
style archiving -- archive all objects of a hierarchy in child messages of 
the top message. That's not only a compatibility problem where old and new 
code are mixed, since one could decide to archive a sub or unrelated 
hierarchy in a separate message on purpose. E.g. imaging that during 
unarchiving a window some view accesses a global settings singleton, which 
in turn has to lazily unarchive a settings file.

CU, Ingo

Other related posts: