lua-users home
lua-l archive

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


Roberto wrote:
Are there issues with Lua 5.1 for real time work?

Its atomic section must traverse all stacks and all weak tables of the
program. If you have lots of them (and they are big) the atomic step may
take a while to complete.

Moreover, each atomic step does not stop during a traversal. So, if you
have one really big table in your program, its traversal may take a
while too.

Compared to non-incremental mark-and-sweep, it's much easier to control your application's maximum table size than its total number of objects. Throwing reference counting into the comparison as well, we have:

  method of garbage collection  worst case GC duration
  ----------------------------  ----------------------
  mark-and-sweep                O(num objects)
  reference counting            O(num unreferenced objects + X)
  incremental mark-and-sweep    O(max table size + X)

where X is (stack size + num weak tables).  Does that look right?

-John

--
http://giftfile.org/  ::  giftfile project