This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: garbage collection pauses: too long for a game?


Kalle Niemitalo <tosi@ees2.oulu.fi> writes:

 > I'm thinking of adding Guile support in DUMB
 > (http://samba.anu.edu.au/dumb/) but I fear the gameplay could be
 > ruined by Guile stopping to collect garbage.  Is garbage collection
 > fast enough to go unnoticed?
 > 
 > Also, can it be synchronised in a network game, so that everyone's
 > Guile collects garbage at the same time?  This could stop GCing
 > players from being shot.
 > 
 > I know something about Scheme but practically nothing about Guile.

I wrote a tetris program in scheme (stetris) using STk. The GC pauses
were somewhat annoying until I a) increased the initial heap size (to
make GC less frequent) and b) forced gc by executing (gc) at times
when variable gc pauses weren't noticeable, namely when the piece hits
the bottom & when the filled rows are cleared.  This sufficed to
prevent gc from occurring at the wrong time & the pauses ceased to be
a problem.

You could probably do something similar.

-- 
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il