On Sun, Apr 10, 2011 at 1:43 PM, Robert wrote:

> As discussed in "Stuttering at 1 Hz rate" we now know that regular and
> unpleasant stuttering is caused by Nasals garbage collector.
> So I thought about possibilities to improve it.
> What if we could decouple the following function as a separate thread, so
> that it runs *asynchronously* from the main thread?
> This way it would not interfere (or much less) with the main thread and our
> fps would be more consistent.
>
> This is the function causing the jitter:
> In "simgear/nasal/gc.c"
> static void garbageCollect()
>
> The thread will need to share some of the global variables from the main
> thread.
> Unfortunately I have no experience with thread programming. But I'm sure
> there are some skilled programmers in the FG-community.
>

Danger danger Will Robinson! :-)

I'm not an expert in nasal garbage collection, but I think the problem is
that garbage collection is not something we can divide up into chunks (which
is essentially what threading would do.)  In addition, threading adds a lot
of potential order dependent bugs.  I've got a whole soapbox speech on
threading I could deliver which I would summarize as "only if absolutely no
other solution is viable."

In the case of nasal, I believe the garbage collection pass must be done in
a single atomic step, otherwise it would leave the heap in
an inconsistent state and adversely affect the scripts.

Regards,

Curt.
-- 
Curtis Olson:
http://www.atiak.com - http://aem.umn.edu/~uav/
http://www.flightgear.org -
http://gallinazo.flightgear.org<http://www.flightgear.org/blogs/category/personal/curt/>
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to