Re: buffer.c of buffer.patch

From: Daniel W. Burke (dwb@IX.NETCOM.COM)
Date: 08/02/97


On Sun, 3 Aug 1997, George wrote:

> On Fri, 1 Aug 1997, Daniel W. Burke wrote:
>
> release_all_buffers() is only called during game_loop(), thus it is not
> available while the MUD is booting, except for a couple I threw in for
> sanity's sake.  It is a good idea because you can:
> a) reduce the number of calls to release_all_bufffers()
> b) reduce the number of buffers created when ones could be reused
>
> >Seems that it would actually be a time saver (although we're probably
> >only talking minor times here, but anyways) to leave the unused buffers
> >to "idle" out in 5 minutes in release_all_buffers().
>
> All buffers are cleared for usage every pulse although it makes sense to
> call it less.
>
> The idle out is to prevent excess buffers that just 'hang out'.  You can
> arbitrarily increase it or decrease it.
>
> And if you comment out the debugging messages, you never have to worry
> about release_buffer()...and if you do care, the code will tell you who
> forgot to free it.
>

My original post was done in some ignorance.  I had been expermenting
with the code, but I did not know until going over the code in detail,
that release_buffer() doesn't free the buffer, it just clears it so that
it can be used by someone else.

A way to reduce the calls to release_all_buffers() is to instead of
calling it ever pulse (10 times a second) make it only called (and need
to be called) once a second.  just make a PULSE_BUFFER that's (1 RL_SEC)
and change BUFFER_LIFE to (5*SECS_PER_REAL_MIN) or (300 RL_SEC) (the
equvilant).

I plan on experimenting with this more though.  It crashes on me when
freeing more then a couple buffers at a time it seems.


Brazil - Implementor of AddictMUD
         addict.realms.org  4000
         206.185.32.8       4000


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST