[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] Re: [Gnash] Playing multiple movies at the same time
From: |
strk |
Subject: |
Re: [Gnash-dev] Re: [Gnash] Playing multiple movies at the same time |
Date: |
Mon, 20 Aug 2007 12:25:19 +0200 |
On Mon, Aug 20, 2007 at 12:07:22PM +0200, Sergio Garcia wrote:
> I was thinking in having multiple instances of the vm at the same time, each
> with
> it's own movie, renderers, gc and so on.
Yes, that would be even better, but of course it's more work :)
> I think that the first step should moving all the static functions and objets
> to the VM class or create a new one for that pourposse and point the static
> function
> to it. For example:
I reccommend using the existing one. One nice thing of singletons is that it's
easier to make them non-singleton classes.
> void VM::set_base_url(const URL& url)
> {
> // can call this only once during a single run
> assert(!globals::baseurl.get());
> globals::baseurl.reset(new URL(url));
> log_msg(_("Base url set to: %s"), globals::baseurl->str().c_str());
> }
> void
> set_base_url(const URL& url)
> {
> VN::get().set_base_url(url);
> }
Well, if the VM is not a singleton, VM::get() wouldn't make sense anymore.
Rather, all VM-related parts (including characters, and the movie_root (stage))
would
need to have it's own pointer to the VM.
> Later we should remove the static function call and add the reference to the
> appropiate
> objects.
Right.
> >We are actually using a thread to load the movie in the core lib already,
> >with
> >assertion checking that the loader/parser thread doesn't mess with the
> >garbage
> >collector
> >at all.
>
> Then what does it mean the
> assert(self == mainThread);
> in GC.h??
It means that the loader/parser thread is not allowed to create GC-managed
objects.
And it's not, AFAIKT.
If we'll go multiple GC (one for each VM) then that assertion should check that
the thread creating the GC-managed object is the same that will run the
collector
(if mainThread is set at GC creation time should be fine as it is).
--strk;