How the Nasal GC works: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
Line 16: Line 16:


The garbage collector in Nasal is pretty self-contained and entirely implemented in the file [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c gc.c].
The garbage collector in Nasal is pretty self-contained and entirely implemented in the file [https://gitorious.org/fg/simgear/blobs/next/simgear/nasal/gc.c gc.c].
{{FGCquote
  |Nasal's garbage collector requires that no other Nasal threads are <br/>
running, and achieves this by keeping a count of active Nasal threads <br/>
(nThreads, simgear/nasal/code.h), and having the thread that needs GC <br/>
ask all other threads to stop and wait until nThreads-1 say they have <br/>
(bottleneck(), simgear/nasal/gc.c).  This will hang if there are any <br/>
threads that Nasal thinks are active but actually aren't, as they will <br/>
never reply to the stop request.
  |{{cite web |url=http://sourceforge.net/p/flightgear/mailman/message/32969200/
    |title=<nowiki>[Flightgear-devel] Nasal threading, naCall() vs naCallMethodCtx()</nowiki>
    |author=<nowiki>Rebecca N. Palmer</nowiki>
    |date=<nowiki>2014-10-25</nowiki>
  }}
}}




Navigation menu