On Wed, 23 May 2012, Stefan Seifert wrote:

> Maybe even simpler: run the GC in a separate thread. Threaded GC usually is
> quite tricky but in this case it may not be that much of a problem. Is there
> any time during processing a new frame when no Nasal is run but something else
> which is time consuming? This could be the perfect point to hide the GC's
> latency. FG does not use multiple cores that well so there should be at least
> one core which is bored and might tend to the garbage instead while the main
> thread is busy rendering pretty graphics. A single condition var might be
> enough to ensure that the GC is not running at the same time as Nasal
> execution.
>
> In my naive imagingation, this sounds like a single evening experiment ;)

It was, but there is still the issue that you can't execute Nasal while 
the GC is running (for that you'd need a concurrent GC which is most 
likely not so easily implemented). The implication is that if the time 
required for a collection exceeds the frame dealy you'll still notice it 
even when the GC runs in a different thread.

I have updated my experimental patch from last year, which should also 
work on Windows now (and it has even been tested there):

http://sleipner.gidenstam.org/users/anders/FlightGear/sg-gc-4.diff
http://sleipner.gidenstam.org/users/anders/FlightGear/fg-gc-3.diff

Again:
It doesn't solve the bigger problem of the current Nasal GC needing to
run uninterrupted and in mutual exclusion - but I see very few GC runs in
the main loop here (the patch prints "** Nasal GC in main thread **"
in the console when that happens) except a few during startup.

Cheers,

Anders
-- 
---------------------------------------------------------------------------
Anders Gidenstam
WWW: http://gitorious.org/anders-hangar
      http://www.gidenstam.org/FlightGear/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to