FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Does minid have deterministic garbage collection like Squirr

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
consolejoker



Joined: 18 Sep 2007
Posts: 2

PostPosted: Tue Sep 18, 2007 9:37 am    Post subject: Does minid have deterministic garbage collection like Squirr Reply with quote

Squirrel uses reference counting for determinism in its collection and backs it up with mark and sweep to deal with any straggling cyclical references.

This approach sets it aside from almost all other languages which cannot be guaranteed not to interfere with bursts of GC cycles, which kills it for game dev.

Does mind borrow this great approach?
Back to top
View user's profile Send private message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Tue Sep 18, 2007 12:34 pm    Post subject: Reply with quote

The reference implementation of MiniD uses whatever garbage collector the underlying D runtime uses. As of now it's rather difficult/unwieldy to implement reference counting in D, mostly because you can't override the dot operator or the copy operator (the copy operator being an assignment from one class object to another). The copy operator at least will be overloadable in the future, in D2, but who knows how far off that is.

That being said, the language specification puts no restrictions on what kind of garbage collector the language implementation should use, meaning that if someone wanted to make a MiniD implementation that did use reference counting and GC to manage memory, that would be fine. Hell, I'd like to do it eventually, though it'd be a pain to do so without language support from D. The native API would become much uglier.

[edit]I guess if you want a very literal answer to your question, though, yes, the reference implementation of MiniD does have a deterministic collector, but not like Squirrel. The default D collector will only collect on allocations, and only when memory's getting short. Don't allocate, and you won't get any collections. Wink


Last edited by JarrettBillingsley on Wed Sep 19, 2007 7:11 am; edited 1 time in total
Back to top
View user's profile Send private message
div0



Joined: 10 Sep 2007
Posts: 19
Location: tedium city, uk

PostPosted: Tue Sep 18, 2007 12:44 pm    Post subject: Re: Does minid have deterministic garbage collection like Sq Reply with quote

consolejoker wrote:
Squirrel uses reference counting for determinism in its collection and backs it up with mark and sweep to deal with any straggling cyclical references.

This approach sets it aside from almost all other languages which cannot be guaranteed not to interfere with bursts of GC cycles, which kills it for game dev.

Does mind borrow this great approach?


Wow sounds like all the draw backs of reference counting coupled with all the drawbacks of gc. Wink

Minid uses the d gc iirc.

http://www.digitalmars.com/d/garbage.html

I would suck it and see first.

It's unlikely you'd be creating/destroying lots of objects in scripts called from a game engine, and the gc won't run until memory gets tight anyway.

If you stick to the traditional pause to load a level, you can force a gc cycle after loading the level which will practically guarantees the gc won't need to run again during the level.

There's also std.gc.disable() if you're really that paranoid...
Back to top
View user's profile Send private message
consolejoker



Joined: 18 Sep 2007
Posts: 2

PostPosted: Tue Sep 18, 2007 2:11 pm    Post subject: Re: Does minid have deterministic garbage collection like Sq Reply with quote

div0 wrote:
consolejoker wrote:
Squirrel uses reference counting for determinism in its collection and backs it up with mark and sweep to deal with any straggling cyclical references.

This approach sets it aside from almost all other languages which cannot be guaranteed not to interfere with bursts of GC cycles, which kills it for game dev.

Does mind borrow this great approach?


Wow sounds like all the draw backs of reference counting coupled with all the drawbacks of gc. Wink

Minid uses the d gc iirc.

http://www.digitalmars.com/d/garbage.html

I would suck it and see first.

It's unlikely you'd be creating/destroying lots of objects in scripts called from a game engine, and the gc won't run until memory gets tight anyway.

If you stick to the traditional pause to load a level, you can force a gc cycle after loading the level which will practically guarantees the gc won't need to run again during the level.

There's also std.gc.disable() if you're really that paranoid...


No thanks, I'm looking for guarantees. When you ship a title onto a CD for a console, there are no second shots. So yeah, paranoia is part of the job.

I guess right now its not fit for games. Squirrel has shipped in commercial games, the drawbacks of both methods do not outweigh the benefits, namely determinism.

Thx.
Back to top
View user's profile Send private message
div0



Joined: 10 Sep 2007
Posts: 19
Location: tedium city, uk

PostPosted: Tue Sep 18, 2007 2:44 pm    Post subject: Re: Does minid have deterministic garbage collection like Sq Reply with quote

consolejoker wrote:
I guess right now its not fit for games.


In my xp so far, it's unfortunately not fit for anything.
Looks very promising but unless you are writing all your own libraries from scratch...
I certainly wouldn't start any sort of commercial application with D at the minute.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group