D on next-gen consoles and for game development

Dicebot m.strashun at gmail.com
Fri May 24 03:38:40 PDT 2013


On Friday, 24 May 2013 at 10:24:13 UTC, Regan Heath wrote:
> It's not the allocation caused by ~ which is the issue though 
> is it, it's the collection it might trigger, right?

Depends. When it comes to real-time software you can't say 
without studying specific task requirements. Stop-the-world 
collection is a complete disaster but, for example, if you 
consider concurrent one like Leandro has shown - it can satisfy 
soft real-time requirements. But only if heap size managed by GC 
stays reasonably low - thus the need to control that you don't 
allocate in an unexpected ways.

> So what you really need are 3 main things:
>
> 1. A way to prevent the GC collecting until a given point(*).

You can do it now. Does not help if world is stopped and/or you 
can't limit collection time.

> 2. A way to limit the GC collection time.

Or run it concurrently with low priority. Will do for lot of 
_soft_ real-time.

> 3. For phobos functions to be optimised to not allocate or to 
> use alloca where possible.

Really important one as helps not only game dev / soft real-time 
servers, but also hardcore embedded.



More information about the Digitalmars-d mailing list