Re: buffer.c of buffer.patch

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 08/03/97


On Sat, 2 Aug 1997, Daniel W. Burke wrote:
>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.

Right :)

>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).

It'd move it out of game_loop() to heartbeat() in that case.

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

I had the same problem.  After freeing about 10 buffers from idle timeout,
it crashed with a Bus Error(!?)...so I coded it to only free one buffer per
pass through release_all_buffers()  The 'freed' variable should do that.

I would guess the Bus error was due to the lack of memory on my machine at
the time and freeing all the memory couldn't remove it from the swap fast
enough...first time I've ever seen that one besides Netscape for Linux
which kills itself with SIGBUS when it receives SIGSEGV.

--
greerga@muohio.edu me@null.net | Genius may have its limitations, but stupidity
http://www.muohio.edu/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | 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