Julia for soft (or hard) real-time - state of the GC - usable already? In 0.4 w/new GC

246 views
Skip to first unread message

Páll Haraldsson

unread,
May 15, 2015, 8:21:50 AM5/15/15
to juli...@googlegroups.com

At least soft-realtime should be just as doable (say for games/audio/video/software defined radio?) as with Lua (and C++ game engine..):

"With soft-realtime you need to specify more parameters[..]
As Thomas already said: avoiding allocations is the simplest
recipe.

But the incremental GC in LuaJIT 2.0 (same as Lua 5.1) is not that
bad. It does have some atomic pauses that may be of concern:

- Stacks are traversed atomically -- don't create huge stacks
  (deep recursion).

- Each table is traversed atomically -- don't create huge tables
  (millions of elements). Or consider using FFI structures."


I think that is the heart of the problem ("atomic pauses") with real-time GC. Since Java can have real-time GC I assume Julia could too. That is what they do, do not atomically scan big structures. It's probably heroic optimizations - not for target audience of Julia, but can it be done? And pluggable GC? Anyway, I'm not too concerned with hard-real-time, soft will do. Is Julia at least as good as Lua?

[I think Java is allowed to move objects (but not Julia? Or not always? Because of C FFI). For real-time, I think that is however irrelevant.]

Huge arrays (as in a game engine/particle system) shouldn't be a problem as (when) would not contain pointers? You know that by the type.

Note:
"Lua implements an incremental mark-and-sweep collector. It uses two numbers to control its garbage-collection cycles: the garbage-collector pause and the garbage-collector step multiplier. Both use percentage points as units (so that a value of 100 means an internal value of 1)."

Unlike Python, that has reference counting (and then GC on top), that is used in a few games (Eve online, using stackless Python), Lua is used in a huge amount of games with full GC. I forsee Julia could (mostly) eliminate the two-language "problem"/division games have, game engines could be written in Julia also (but you might not want to reimplement, just wrap C++).

Came from here - also interesting..:
http://lukego.github.io/blog/2012/09/25/lukes-highly-opinionated-programming-language-roundup-2012/

-- 
Palli.

Tony Kelman

unread,
May 16, 2015, 1:36:38 PM5/16/15
to juli...@googlegroups.com
I think this thread would be more appropriate for julia-users, unless you're proposing starting work on a new pluggable GC yourself and would like to get advice on where to start. Experimenting with alternate GC implementations or other memory management schemes is on a few different people's long term to-do lists with Julia, I'm sure.
Reply all
Reply to author
Forward
0 new messages