On 26.03.2011 10:03, Tim Moore wrote: > Reference counting doesn't provide a strong performance advantage over > conventional garbage collection, and a reference-counting scheme can > take an unbounded amount of time. Reference counting schemes that do > have real-time or bounded behavior are very complicated. Well, the issue with scanning for unreachable objects is that it scales with the number of data elements in memory. Even when you aren't touching the data structures, they still affect performance. Reference counting itself doesn't guarantee real-time behavior, since removing any reference may result in deleting large data structures. But it's much more predictable and can be influence in the code. When certain code doesn't touch anything large, then it isn't affected. There are real-time systems which have successfully integrated a Python engine because of this. Though it doesn't guarantee hard real-time "by the book", it still works very, very well, and only require few limitations (i.e. you have to avoid cyclic data structures, or accept that they are leaking).
> I don't know much about our Nasal implementation, but I suspect that > the garbage collector could be changed to trace only a portion of > Nasal's heap at each invocation, at the risk of increased memory use. Hm, not sure. The garbage collector uses "mark & sweep". It locks out any concurrent Nasal execution, marks all reachable elements, then removes everything unreachable, finally unlocks the engine. The expensive bit is the marking of all elements. It's hard to split such a task. You could abort the operation, but then later have to start all over again, to be sure that you've really traced all references. cheers, Thorsten ------------------------------------------------------------------------------ Enable your software for Intel(R) Active Management Technology to meet the growing manageability and security demands of your customers. Businesses are taking advantage of Intel(R) vPro (TM) technology - will your software be a part of the solution? Download the Intel(R) Manageability Checker today! http://p.sf.net/sfu/intel-dev2devmar _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel