Thread overview
I wish Dlang had incremental and concurrent garbage collection
Jan 11, 2020
James Lu
Jan 30, 2020
bauss
Jan 31, 2020
JN
January 11, 2020
I have a single-threaded, highly stateful application, a networked multiplayer game. It must run on the server at 25FPS. What progress is there on giving D a GC mode that "spreads out" the cost of doing GC?
January 30, 2020
On Saturday, 11 January 2020 at 21:10:45 UTC, James Lu wrote:
> I have a single-threaded, highly stateful application, a networked multiplayer game. It must run on the server at 25FPS. What progress is there on giving D a GC mode that "spreads out" the cost of doing GC?

What's stopping you from creating multiple threads?

You can easily have a network thread and a UI thread and simply pass any data to the network thread from the UI thread and the other way around too using std.concurrency.

I've done that myself and it works fine and can definitely run at a faster FPS than 25 too.
January 31, 2020
On Saturday, 11 January 2020 at 21:10:45 UTC, James Lu wrote:
> I have a single-threaded, highly stateful application, a networked multiplayer game. It must run on the server at 25FPS. What progress is there on giving D a GC mode that "spreads out" the cost of doing GC?

Have you actually done any profiling that shows that D's GC is preventing you from achieving 25 FPS? 25 FPS is 40 ms, I don't know how much your update loop takes, but I don't think the D GC pauses would be this long?
February 01, 2020
On Friday, 31 January 2020 at 10:35:45 UTC, JN wrote:
> Have you actually done any profiling that shows that D's GC is preventing you from achieving 25 FPS? 25 FPS is 40 ms, I don't know how much your update loop takes, but I don't think the D GC pauses would be this long?

Note also that it's also readily possible to architect a D app to use resource pools, reusable buffers, etc. such that GC cycles are never triggered.