gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Re: SWF streaming


From: Rob Savoye
Subject: Re: [Gnash-dev] Re: SWF streaming
Date: Sat, 12 Aug 2006 15:19:10 -0600
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

strk wrote:

> I thought we were avoiding threads, but if everyone is ok with
> it I will inspect possibilities for it. Actually a thread would
> be a convenient solution as the thread could be removed as soon
> as the movie is fully loaded.

  Exactly. For GameSWF, thread usage was discouraged, but I'm a big fan
of using POSIX threads. In fact, I'd like to use the "Fast Events for
SDL", which uses a background thread to pump the SDL event loop at a
much higher rate.

> The only problem I can think of is at frame-advance time, in case the next
> frame has not been loaded yet. We'd likely want to render the frame as soon
> as it's loaded rather then skip the operation and wait next 1/FPS seconds.

  You could use a POSIX condition variable that if it's set, it'd stall
till the frame is loaded. When loaded, the background thread would clear
the mutex for the condition.

  Don't forget to use mutexes for any global variables that may get
modified by both threads.

        - rob -




reply via email to

[Prev in Thread] Current Thread [Next in Thread]